<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html xmlns:yui="http://yuilibrary.com/rdf/1.0/yui.rdf#">
<head>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8" />
	<title>API: imagecropper   crop.js  (YUI Library)</title>

	<link rel="stylesheet" type="text/css" href="assets/reset-fonts-grids-min.css" />
	<link rel="stylesheet" type="text/css" href="assets/api.css" />

    <script type="text/javascript" src="assets/api-js"></script>
    <script type="text/javascript" src="assets/ac-js"></script>
</head>

<body id="yahoo-com">

<div id="doc3" class="yui-t2">
	<div id="hd">
        <h1><a href="http://developer.yahoo.com/yui/" title="Yahoo! UI Library">Yahoo! UI Library</a></h1>
        <h3>imagecropper&nbsp; <span class="subtitle">2.8.0</span></h3>
        <a href="./index.html" title="Yahoo! UI Library">Yahoo! UI Library</a> 
            &gt; <a href="./module_imagecropper.html" title="imagecropper">imagecropper</a>
                
                 &gt; crop.js (source view) 
        <form onsubmit="return false">
            <div id="propertysearch">
                Search: <input autocomplete="off" id="searchinput" />
                <div id="searchresults">
                    &nbsp;
                </div>
            </div>
        </form>
	</div>

	<div id="bd">
		<div id="yui-main">
			<div class="yui-b">
            <form action="#" name="yui-classopts-form" method="get" id="yui-classopts-form">
                <fieldset>
                    <legend>Filters</legend>
                <span class="classopts"><input type="checkbox" name="show_private" id="show_private" /> <label for="show_private">Show Private</label></span>
                <span class="classopts"><input type="checkbox" name="show_protected" id="show_protected" /> <label for="show_protected">Show Protected</label></span>
                <span class="classopts"><input type="checkbox" name="show_deprecated" id="show_deprecated" /> <label for="show_deprecated">Show Deprecated</label></span>
                </fieldset>
            </form>

                    <div id="srcout">
                        <style>
                            #doc3 .classopts { display:none; }
                        </style>
                        <div class="highlight" ><pre><span class="c">/**</span>
<span class="c"> * @description &lt;p&gt;Creates a Image Cropper control.&lt;/p&gt;</span>
<span class="c"> * @namespace YAHOO.widget</span>
<span class="c"> * @requires yahoo, dom, dragdrop, element, event, resize</span>
<span class="c"> * @module imagecropper</span>
<span class="c"> * @beta</span>
<span class="c"> */</span>
<span class="o">(</span><span class="k">function</span><span class="o">()</span> <span class="o">{</span>
<span class="k">var</span> <span class="nx">Dom</span> <span class="o">=</span> <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">util</span><span class="o">.</span><span class="nx">Dom</span><span class="o">,</span>
    <span class="nx">Event</span> <span class="o">=</span> <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">util</span><span class="o">.</span><span class="nx">Event</span><span class="o">,</span>
    <span class="nx">Lang</span> <span class="o">=</span> <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">lang</span><span class="o">;</span>

    <span class="c">/**</span>
<span class="c">     * @constructor</span>
<span class="c">     * @class ImageCropper</span>
<span class="c">     * @description &lt;p&gt;Creates a Image Cropper control.&lt;/p&gt;</span>
<span class="c">     * @extends YAHOO.util.Element</span>
<span class="c">     * @param {String/HTMLElement} el The image element to make croppable.</span>
<span class="c">     * @param {Object} attrs Object liternal containing configuration parameters.</span>
<span class="c">    */</span>
    <span class="k">var</span> <span class="nx">Crop</span> <span class="o">=</span> <span class="k">function</span><span class="o">(</span><span class="nx">el</span><span class="o">,</span> <span class="nx">config</span><span class="o">)</span> <span class="o">{</span>
        <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">log</span><span class="o">(</span><span class="s1">&#39;Initializing&#39;</span><span class="o">,</span> <span class="s1">&#39;log&#39;</span><span class="o">,</span> <span class="s1">&#39;ImageCropper&#39;</span><span class="o">);</span>
        <span class="k">var</span> <span class="nx">oConfig</span> <span class="o">=</span> <span class="o">{</span>
            <span class="nx">element</span><span class="o">:</span> <span class="nx">el</span><span class="o">,</span>
            <span class="nx">attributes</span><span class="o">:</span> <span class="nx">config</span> <span class="o">||</span> <span class="o">{}</span>
        <span class="o">};</span>

        <span class="nx">Crop</span><span class="o">.</span><span class="nx">superclass</span><span class="o">.</span><span class="nx">constructor</span><span class="o">.</span><span class="nx">call</span><span class="o">(</span><span class="k">this</span><span class="o">,</span> <span class="nx">oConfig</span><span class="o">.</span><span class="nx">element</span><span class="o">,</span> <span class="nx">oConfig</span><span class="o">.</span><span class="nx">attributes</span><span class="o">);</span>    
    <span class="o">};</span>

    <span class="c">/**</span>
<span class="c">    * @private</span>
<span class="c">    * @static</span>
<span class="c">    * @property _instances</span>
<span class="c">    * @description Internal hash table for all ImageCropper instances</span>
<span class="c">    * @type Object</span>
<span class="c">    */</span> 
    <span class="nx">Crop</span><span class="o">.</span><span class="nx">_instances</span> <span class="o">=</span> <span class="o">{};</span>
    <span class="c">/**</span>
<span class="c">    * @static</span>
<span class="c">    * @method getCropperById </span>
<span class="c">    * @description Get&#39;s an ImageCropper object by the HTML id of the image associated with the ImageCropper object.</span>
<span class="c">    * @return {Object} The ImageCropper Object</span>
<span class="c">    */</span> 
    <span class="nx">Crop</span><span class="o">.</span><span class="nx">getCropperById</span> <span class="o">=</span> <span class="k">function</span><span class="o">(</span><span class="nx">id</span><span class="o">)</span> <span class="o">{</span>
        <span class="k">if</span> <span class="o">(</span><span class="nx">Crop</span><span class="o">.</span><span class="nx">_instances</span><span class="o">[</span><span class="nx">id</span><span class="o">])</span> <span class="o">{</span>
            <span class="k">return</span> <span class="nx">Crop</span><span class="o">.</span><span class="nx">_instances</span><span class="o">[</span><span class="nx">id</span><span class="o">];</span>
        <span class="o">}</span>
        <span class="k">return</span> <span class="kc">false</span><span class="o">;</span>
    <span class="o">};</span>

    <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">extend</span><span class="o">(</span><span class="nx">Crop</span><span class="o">,</span> <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">util</span><span class="o">.</span><span class="nx">Element</span><span class="o">,</span> <span class="o">{</span>
        <span class="c">/**</span>
<span class="c">        * @private</span>
<span class="c">        * @property CSS_MAIN</span>
<span class="c">        * @description The CSS class used to wrap the element </span>
<span class="c">        * @type String</span>
<span class="c">        */</span>
        <span class="nx">CSS_MAIN</span><span class="o">:</span> <span class="s1">&#39;yui-crop&#39;</span><span class="o">,</span>
        <span class="c">/**</span>
<span class="c">        * @private</span>
<span class="c">        * @property CSS_MASK</span>
<span class="c">        * @description The CSS class for the mask element</span>
<span class="c">        * @type String</span>
<span class="c">        */</span>
        <span class="nx">CSS_MASK</span><span class="o">:</span> <span class="s1">&#39;yui-crop-mask&#39;</span><span class="o">,</span>
        <span class="c">/**</span>
<span class="c">        * @private</span>
<span class="c">        * @property CSS_RESIZE_MASK</span>
<span class="c">        * @description The CSS class for the mask inside the resize element</span>
<span class="c">        * @type String</span>
<span class="c">        */</span>
        <span class="nx">CSS_RESIZE_MASK</span><span class="o">:</span> <span class="s1">&#39;yui-crop-resize-mask&#39;</span><span class="o">,</span>

        <span class="c">/**</span>
<span class="c">        * @private</span>
<span class="c">        * @property _image</span>
<span class="c">        * @description The url of the image we are cropping</span>
<span class="c">        * @type String</span>
<span class="c">        */</span>
        <span class="nx">_image</span><span class="o">:</span> <span class="kc">null</span><span class="o">,</span>
        <span class="c">/**</span>
<span class="c">        * @private</span>
<span class="c">        * @property _active</span>
<span class="c">        * @description Flag to determine if the crop region is active</span>
<span class="c">        * @type Boolean</span>
<span class="c">        */</span>
        <span class="nx">_active</span><span class="o">:</span> <span class="kc">null</span><span class="o">,</span>
        <span class="c">/**</span>
<span class="c">        * @private</span>
<span class="c">        * @property _resize</span>
<span class="c">        * @description A reference to the Resize Utility used in this Cropper Instance</span>
<span class="c">        * @type Object</span>
<span class="c">        */</span>
        <span class="nx">_resize</span><span class="o">:</span> <span class="kc">null</span><span class="o">,</span>
        <span class="c">/**</span>
<span class="c">        * @private</span>
<span class="c">        * @property _resizeEl</span>
<span class="c">        * @description The HTML Element used to create the Resize Oject</span>
<span class="c">        * @type HTMLElement</span>
<span class="c">        */</span>
        <span class="nx">_resizeEl</span><span class="o">:</span> <span class="kc">null</span><span class="o">,</span>
        <span class="c">/**</span>
<span class="c">        * @private</span>
<span class="c">        * @property _resizeMaskEl</span>
<span class="c">        * @description The HTML Element used to create the Resize mask</span>
<span class="c">        * @type HTMLElement</span>
<span class="c">        */</span>
        <span class="nx">_resizeMaskEl</span><span class="o">:</span> <span class="kc">null</span><span class="o">,</span>
        <span class="c">/**</span>
<span class="c">        * @private</span>
<span class="c">        * @property _wrap</span>
<span class="c">        * @description The HTML Element created to wrap the image</span>
<span class="c">        * @type HTMLElement</span>
<span class="c">        */</span>
        <span class="nx">_wrap</span><span class="o">:</span> <span class="kc">null</span><span class="o">,</span>
        <span class="c">/**</span>
<span class="c">        * @private</span>
<span class="c">        * @property _mask</span>
<span class="c">        * @description The HTML Element created to &quot;mask&quot; the image being cropped</span>
<span class="c">        * @type HTMLElement</span>
<span class="c">        */</span>
        <span class="nx">_mask</span><span class="o">:</span> <span class="kc">null</span><span class="o">,</span>
        <span class="c">/**</span>
<span class="c">        * @private</span>
<span class="c">        * @method _createWrap</span>
<span class="c">        * @description Creates the wrapper element used to wrap the image</span>
<span class="c">        */</span>
        <span class="nx">_createWrap</span><span class="o">:</span> <span class="k">function</span><span class="o">()</span> <span class="o">{</span>
            <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">log</span><span class="o">(</span><span class="s1">&#39;Creating the wrap element&#39;</span><span class="o">,</span> <span class="s1">&#39;log&#39;</span><span class="o">,</span> <span class="s1">&#39;ImageCropper&#39;</span><span class="o">);</span>
            <span class="k">this</span><span class="o">.</span><span class="nx">_wrap</span> <span class="o">=</span> <span class="nb">document</span><span class="o">.</span><span class="nx">createElement</span><span class="o">(</span><span class="s1">&#39;div&#39;</span><span class="o">);</span>
            <span class="k">this</span><span class="o">.</span><span class="nx">_wrap</span><span class="o">.</span><span class="nx">id</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">get</span><span class="o">(</span><span class="s1">&#39;element&#39;</span><span class="o">).</span><span class="nx">id</span> <span class="o">+</span> <span class="s1">&#39;_wrap&#39;</span><span class="o">;</span>
            <span class="k">this</span><span class="o">.</span><span class="nx">_wrap</span><span class="o">.</span><span class="nx">className</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">CSS_MAIN</span><span class="o">;</span>
            <span class="k">var</span> <span class="nx">el</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">get</span><span class="o">(</span><span class="s1">&#39;element&#39;</span><span class="o">);</span>
            <span class="k">this</span><span class="o">.</span><span class="nx">_wrap</span><span class="o">.</span><span class="nx">style</span><span class="o">.</span><span class="nx">width</span> <span class="o">=</span> <span class="nx">el</span><span class="o">.</span><span class="nx">width</span> <span class="o">?</span> <span class="nx">el</span><span class="o">.</span><span class="nx">width</span> <span class="o">+</span> <span class="s1">&#39;px&#39;</span> <span class="o">:</span> <span class="nx">Dom</span><span class="o">.</span><span class="nx">getStyle</span><span class="o">(</span><span class="nx">el</span><span class="o">,</span> <span class="s1">&#39;width&#39;</span><span class="o">);</span>
            <span class="k">this</span><span class="o">.</span><span class="nx">_wrap</span><span class="o">.</span><span class="nx">style</span><span class="o">.</span><span class="nx">height</span> <span class="o">=</span> <span class="nx">el</span><span class="o">.</span><span class="nx">height</span> <span class="o">?</span> <span class="nx">el</span><span class="o">.</span><span class="nx">height</span> <span class="o">+</span> <span class="s1">&#39;px&#39;</span> <span class="o">:</span> <span class="nx">Dom</span><span class="o">.</span><span class="nx">getStyle</span><span class="o">(</span><span class="nx">el</span><span class="o">,</span> <span class="s1">&#39;height&#39;</span><span class="o">);</span>
            
            <span class="k">var</span> <span class="nx">par</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">get</span><span class="o">(</span><span class="s1">&#39;element&#39;</span><span class="o">).</span><span class="nx">parentNode</span><span class="o">;</span>
            <span class="nx">par</span><span class="o">.</span><span class="nx">replaceChild</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">_wrap</span><span class="o">,</span> <span class="k">this</span><span class="o">.</span><span class="nx">get</span><span class="o">(</span><span class="s1">&#39;element&#39;</span><span class="o">));</span>
            <span class="k">this</span><span class="o">.</span><span class="nx">_wrap</span><span class="o">.</span><span class="nx">appendChild</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">get</span><span class="o">(</span><span class="s1">&#39;element&#39;</span><span class="o">));</span>

            <span class="nx">Event</span><span class="o">.</span><span class="nx">on</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">_wrap</span><span class="o">,</span> <span class="s1">&#39;mouseover&#39;</span><span class="o">,</span> <span class="k">this</span><span class="o">.</span><span class="nx">_handleMouseOver</span><span class="o">,</span> <span class="k">this</span><span class="o">,</span> <span class="kc">true</span><span class="o">);</span>
            <span class="nx">Event</span><span class="o">.</span><span class="nx">on</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">_wrap</span><span class="o">,</span> <span class="s1">&#39;mouseout&#39;</span><span class="o">,</span> <span class="k">this</span><span class="o">.</span><span class="nx">_handleMouseOut</span><span class="o">,</span> <span class="k">this</span><span class="o">,</span> <span class="kc">true</span><span class="o">);</span>

            <span class="nx">Event</span><span class="o">.</span><span class="nx">on</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">_wrap</span><span class="o">,</span> <span class="s1">&#39;click&#39;</span><span class="o">,</span> <span class="k">function</span><span class="o">(</span><span class="nx">ev</span><span class="o">)</span> <span class="o">{</span> <span class="nx">Event</span><span class="o">.</span><span class="nx">stopEvent</span><span class="o">(</span><span class="nx">ev</span><span class="o">);</span> <span class="o">},</span> <span class="k">this</span><span class="o">,</span> <span class="kc">true</span><span class="o">);</span>
        <span class="o">},</span>

        <span class="c">/**</span>
<span class="c">        * @private</span>
<span class="c">        * @method _createMask</span>
<span class="c">        * @description Creates the mask element used to mask the image</span>
<span class="c">        */</span>
        <span class="nx">_createMask</span><span class="o">:</span> <span class="k">function</span><span class="o">()</span> <span class="o">{</span>
            <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">log</span><span class="o">(</span><span class="s1">&#39;Creating the Mask&#39;</span><span class="o">,</span> <span class="s1">&#39;log&#39;</span><span class="o">,</span> <span class="s1">&#39;ImageCropper&#39;</span><span class="o">);</span>
            <span class="k">this</span><span class="o">.</span><span class="nx">_mask</span> <span class="o">=</span> <span class="nb">document</span><span class="o">.</span><span class="nx">createElement</span><span class="o">(</span><span class="s1">&#39;div&#39;</span><span class="o">);</span>
            <span class="k">this</span><span class="o">.</span><span class="nx">_mask</span><span class="o">.</span><span class="nx">className</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">CSS_MASK</span><span class="o">;</span>
            <span class="k">this</span><span class="o">.</span><span class="nx">_wrap</span><span class="o">.</span><span class="nx">appendChild</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">_mask</span><span class="o">);</span>
        <span class="o">},</span>

        <span class="c">/**</span>
<span class="c">        * @private</span>
<span class="c">        * @method _createResize</span>
<span class="c">        * @description Creates the resize element and the instance of the Resize Utility</span>
<span class="c">        */</span>
        <span class="nx">_createResize</span><span class="o">:</span> <span class="k">function</span><span class="o">()</span> <span class="o">{</span>
            <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">log</span><span class="o">(</span><span class="s1">&#39;Creating the Resize element&#39;</span><span class="o">,</span> <span class="s1">&#39;log&#39;</span><span class="o">,</span> <span class="s1">&#39;ImageCropper&#39;</span><span class="o">);</span>
            <span class="k">this</span><span class="o">.</span><span class="nx">_resizeEl</span> <span class="o">=</span> <span class="nb">document</span><span class="o">.</span><span class="nx">createElement</span><span class="o">(</span><span class="s1">&#39;div&#39;</span><span class="o">);</span>
            <span class="k">this</span><span class="o">.</span><span class="nx">_resizeEl</span><span class="o">.</span><span class="nx">className</span> <span class="o">=</span> <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">util</span><span class="o">.</span><span class="nx">Resize</span><span class="o">.</span><span class="nx">prototype</span><span class="o">.</span><span class="nx">CSS_RESIZE</span><span class="o">;</span>
            <span class="k">this</span><span class="o">.</span><span class="nx">_resizeEl</span><span class="o">.</span><span class="nx">style</span><span class="o">.</span><span class="nx">position</span> <span class="o">=</span> <span class="s1">&#39;absolute&#39;</span><span class="o">;</span>
            
            <span class="k">this</span><span class="o">.</span><span class="nx">_resizeEl</span><span class="o">.</span><span class="nx">innerHTML</span> <span class="o">=</span> <span class="s1">&#39;&lt;div class=&quot;&#39;</span> <span class="o">+</span> <span class="k">this</span><span class="o">.</span><span class="nx">CSS_RESIZE_MASK</span> <span class="o">+</span> <span class="s1">&#39;&quot;&gt;&lt;/div&gt;&#39;</span><span class="o">;</span>
            <span class="k">this</span><span class="o">.</span><span class="nx">_resizeMaskEl</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">_resizeEl</span><span class="o">.</span><span class="nx">firstChild</span><span class="o">;</span>
            <span class="k">this</span><span class="o">.</span><span class="nx">_wrap</span><span class="o">.</span><span class="nx">appendChild</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">_resizeEl</span><span class="o">);</span>
            <span class="k">this</span><span class="o">.</span><span class="nx">_resizeEl</span><span class="o">.</span><span class="nx">style</span><span class="o">.</span><span class="nx">top</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">get</span><span class="o">(</span><span class="s1">&#39;initialXY&#39;</span><span class="o">)[</span><span class="m">1</span><span class="o">]</span> <span class="o">+</span> <span class="s1">&#39;px&#39;</span><span class="o">;</span>
            <span class="k">this</span><span class="o">.</span><span class="nx">_resizeEl</span><span class="o">.</span><span class="nx">style</span><span class="o">.</span><span class="nx">left</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">get</span><span class="o">(</span><span class="s1">&#39;initialXY&#39;</span><span class="o">)[</span><span class="m">0</span><span class="o">]</span> <span class="o">+</span> <span class="s1">&#39;px&#39;</span><span class="o">;</span>
            <span class="k">this</span><span class="o">.</span><span class="nx">_resizeMaskEl</span><span class="o">.</span><span class="nx">style</span><span class="o">.</span><span class="nx">height</span> <span class="o">=</span> <span class="nb">Math</span><span class="o">.</span><span class="nx">floor</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">get</span><span class="o">(</span><span class="s1">&#39;initHeight&#39;</span><span class="o">))</span> <span class="o">+</span> <span class="s1">&#39;px&#39;</span><span class="o">;</span>
            <span class="k">this</span><span class="o">.</span><span class="nx">_resizeMaskEl</span><span class="o">.</span><span class="nx">style</span><span class="o">.</span><span class="nx">width</span> <span class="o">=</span> <span class="nb">Math</span><span class="o">.</span><span class="nx">floor</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">get</span><span class="o">(</span><span class="s1">&#39;initWidth&#39;</span><span class="o">))</span> <span class="o">+</span> <span class="s1">&#39;px&#39;</span><span class="o">;</span>

            <span class="k">this</span><span class="o">.</span><span class="nx">_resize</span> <span class="o">=</span> <span class="k">new</span> <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">util</span><span class="o">.</span><span class="nx">Resize</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">_resizeEl</span><span class="o">,</span> <span class="o">{</span>
                <span class="nx">knobHandles</span><span class="o">:</span> <span class="kc">true</span><span class="o">,</span>
                <span class="nx">handles</span><span class="o">:</span> <span class="s1">&#39;all&#39;</span><span class="o">,</span>
                <span class="nx">draggable</span><span class="o">:</span> <span class="kc">true</span><span class="o">,</span>
                <span class="nx">status</span><span class="o">:</span> <span class="k">this</span><span class="o">.</span><span class="nx">get</span><span class="o">(</span><span class="s1">&#39;status&#39;</span><span class="o">),</span>
                <span class="nx">minWidth</span><span class="o">:</span> <span class="k">this</span><span class="o">.</span><span class="nx">get</span><span class="o">(</span><span class="s1">&#39;minWidth&#39;</span><span class="o">),</span>
                <span class="nx">minHeight</span><span class="o">:</span> <span class="k">this</span><span class="o">.</span><span class="nx">get</span><span class="o">(</span><span class="s1">&#39;minHeight&#39;</span><span class="o">),</span>
                <span class="nx">ratio</span><span class="o">:</span> <span class="k">this</span><span class="o">.</span><span class="nx">get</span><span class="o">(</span><span class="s1">&#39;ratio&#39;</span><span class="o">),</span>
                <span class="nx">autoRatio</span><span class="o">:</span> <span class="k">this</span><span class="o">.</span><span class="nx">get</span><span class="o">(</span><span class="s1">&#39;autoRatio&#39;</span><span class="o">),</span>
                <span class="nx">height</span><span class="o">:</span> <span class="k">this</span><span class="o">.</span><span class="nx">get</span><span class="o">(</span><span class="s1">&#39;initHeight&#39;</span><span class="o">),</span>
                <span class="nx">width</span><span class="o">:</span> <span class="k">this</span><span class="o">.</span><span class="nx">get</span><span class="o">(</span><span class="s1">&#39;initWidth&#39;</span><span class="o">)</span>
            <span class="o">});</span>

            <span class="k">this</span><span class="o">.</span><span class="nx">_setBackgroundImage</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">get</span><span class="o">(</span><span class="s1">&#39;element&#39;</span><span class="o">).</span><span class="nx">getAttribute</span><span class="o">(</span><span class="s1">&#39;src&#39;</span><span class="o">,</span> <span class="m">2</span><span class="o">));</span>
            <span class="k">this</span><span class="o">.</span><span class="nx">_setBackgroundPosition</span><span class="o">(-(</span><span class="k">this</span><span class="o">.</span><span class="nx">get</span><span class="o">(</span><span class="s1">&#39;initialXY&#39;</span><span class="o">)[</span><span class="m">0</span><span class="o">]),</span>  <span class="o">-(</span><span class="k">this</span><span class="o">.</span><span class="nx">get</span><span class="o">(</span><span class="s1">&#39;initialXY&#39;</span><span class="o">)[</span><span class="m">1</span><span class="o">]));</span>

            <span class="k">this</span><span class="o">.</span><span class="nx">_resize</span><span class="o">.</span><span class="nx">on</span><span class="o">(</span><span class="s1">&#39;startResize&#39;</span><span class="o">,</span> <span class="k">this</span><span class="o">.</span><span class="nx">_handleStartResizeEvent</span><span class="o">,</span> <span class="k">this</span><span class="o">,</span> <span class="kc">true</span><span class="o">);</span>
            <span class="k">this</span><span class="o">.</span><span class="nx">_resize</span><span class="o">.</span><span class="nx">on</span><span class="o">(</span><span class="s1">&#39;endResize&#39;</span><span class="o">,</span> <span class="k">this</span><span class="o">.</span><span class="nx">_handleEndResizeEvent</span><span class="o">,</span> <span class="k">this</span><span class="o">,</span> <span class="kc">true</span><span class="o">);</span>
            <span class="k">this</span><span class="o">.</span><span class="nx">_resize</span><span class="o">.</span><span class="nx">on</span><span class="o">(</span><span class="s1">&#39;dragEvent&#39;</span><span class="o">,</span> <span class="k">this</span><span class="o">.</span><span class="nx">_handleDragEvent</span><span class="o">,</span> <span class="k">this</span><span class="o">,</span> <span class="kc">true</span><span class="o">);</span>
            <span class="k">this</span><span class="o">.</span><span class="nx">_resize</span><span class="o">.</span><span class="nx">on</span><span class="o">(</span><span class="s1">&#39;beforeResize&#39;</span><span class="o">,</span> <span class="k">this</span><span class="o">.</span><span class="nx">_handleBeforeResizeEvent</span><span class="o">,</span> <span class="k">this</span><span class="o">,</span> <span class="kc">true</span><span class="o">);</span>
            <span class="k">this</span><span class="o">.</span><span class="nx">_resize</span><span class="o">.</span><span class="nx">on</span><span class="o">(</span><span class="s1">&#39;resize&#39;</span><span class="o">,</span> <span class="k">this</span><span class="o">.</span><span class="nx">_handleResizeEvent</span><span class="o">,</span> <span class="k">this</span><span class="o">,</span> <span class="kc">true</span><span class="o">);</span>
            <span class="k">this</span><span class="o">.</span><span class="nx">_resize</span><span class="o">.</span><span class="nx">dd</span><span class="o">.</span><span class="nx">on</span><span class="o">(</span><span class="s1">&#39;b4StartDragEvent&#39;</span><span class="o">,</span> <span class="k">this</span><span class="o">.</span><span class="nx">_handleB4DragEvent</span><span class="o">,</span> <span class="k">this</span><span class="o">,</span> <span class="kc">true</span><span class="o">);</span>
        <span class="o">},</span>

        <span class="c">/**</span>
<span class="c">        * @private</span>
<span class="c">        * @method _handleMouseOver</span>
<span class="c">        * @description Handles the mouseover event</span>
<span class="c">        */</span>
        <span class="nx">_handleMouseOver</span><span class="o">:</span> <span class="k">function</span><span class="o">(</span><span class="nx">ev</span><span class="o">)</span> <span class="o">{</span>
            <span class="k">var</span> <span class="nx">evType</span> <span class="o">=</span> <span class="s1">&#39;keydown&#39;</span><span class="o">;</span>
            <span class="k">if</span> <span class="o">(</span><span class="nx">YAHOO</span><span class="o">.</span><span class="nx">env</span><span class="o">.</span><span class="nx">ua</span><span class="o">.</span><span class="nx">gecko</span> <span class="o">||</span> <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">env</span><span class="o">.</span><span class="nx">ua</span><span class="o">.</span><span class="nx">opera</span><span class="o">)</span> <span class="o">{</span>
                <span class="nx">evType</span> <span class="o">=</span> <span class="s1">&#39;keypress&#39;</span><span class="o">;</span>
            <span class="o">}</span>
            <span class="k">if</span> <span class="o">(!</span><span class="k">this</span><span class="o">.</span><span class="nx">_active</span><span class="o">)</span> <span class="o">{</span>
                <span class="k">this</span><span class="o">.</span><span class="nx">_active</span> <span class="o">=</span> <span class="kc">true</span><span class="o">;</span>
                <span class="k">if</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">get</span><span class="o">(</span><span class="s1">&#39;useKeys&#39;</span><span class="o">))</span> <span class="o">{</span>
                    <span class="nx">Event</span><span class="o">.</span><span class="nx">on</span><span class="o">(</span><span class="nb">document</span><span class="o">,</span> <span class="nx">evType</span><span class="o">,</span> <span class="k">this</span><span class="o">.</span><span class="nx">_handleKeyPress</span><span class="o">,</span> <span class="k">this</span><span class="o">,</span> <span class="kc">true</span><span class="o">);</span>
                <span class="o">}</span>
            <span class="o">}</span>
        <span class="o">},</span>
        <span class="c">/**</span>
<span class="c">        * @private</span>
<span class="c">        * @method _handleMouseOut</span>
<span class="c">        * @description Handles the mouseout event</span>
<span class="c">        */</span>
        <span class="nx">_handleMouseOut</span><span class="o">:</span> <span class="k">function</span><span class="o">(</span><span class="nx">ev</span><span class="o">)</span> <span class="o">{</span>
            <span class="k">var</span> <span class="nx">evType</span> <span class="o">=</span> <span class="s1">&#39;keydown&#39;</span><span class="o">;</span>
            <span class="k">if</span> <span class="o">(</span><span class="nx">YAHOO</span><span class="o">.</span><span class="nx">env</span><span class="o">.</span><span class="nx">ua</span><span class="o">.</span><span class="nx">gecko</span> <span class="o">||</span> <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">env</span><span class="o">.</span><span class="nx">ua</span><span class="o">.</span><span class="nx">opera</span><span class="o">)</span> <span class="o">{</span>
                <span class="nx">evType</span> <span class="o">=</span> <span class="s1">&#39;keypress&#39;</span><span class="o">;</span>
            <span class="o">}</span>
            <span class="k">this</span><span class="o">.</span><span class="nx">_active</span> <span class="o">=</span> <span class="kc">false</span><span class="o">;</span>
            <span class="k">if</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">get</span><span class="o">(</span><span class="s1">&#39;useKeys&#39;</span><span class="o">))</span> <span class="o">{</span>
                <span class="nx">Event</span><span class="o">.</span><span class="nx">removeListener</span><span class="o">(</span><span class="nb">document</span><span class="o">,</span> <span class="nx">evType</span><span class="o">,</span> <span class="k">this</span><span class="o">.</span><span class="nx">_handleKeyPress</span><span class="o">);</span>
            <span class="o">}</span>
        <span class="o">},</span>

        <span class="c">/**</span>
<span class="c">        * @private</span>
<span class="c">        * @method _moveEl</span>
<span class="c">        * @description Moves the resize element based on the arrow keys</span>
<span class="c">        */</span>
        <span class="nx">_moveEl</span><span class="o">:</span> <span class="k">function</span><span class="o">(</span><span class="nx">dir</span><span class="o">,</span> <span class="nx">inc</span><span class="o">)</span> <span class="o">{</span>
            <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">log</span><span class="o">(</span><span class="s1">&#39;Moving the element&#39;</span><span class="o">,</span> <span class="s1">&#39;log&#39;</span><span class="o">,</span> <span class="s1">&#39;ImageCropper&#39;</span><span class="o">);</span>
            <span class="k">var</span> <span class="nx">t</span> <span class="o">=</span> <span class="m">0</span><span class="o">,</span> <span class="nx">l</span> <span class="o">=</span> <span class="m">0</span><span class="o">,</span>
                <span class="nx">region</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">_setConstraints</span><span class="o">(),</span>
                <span class="nx">resize</span> <span class="o">=</span> <span class="kc">true</span><span class="o">;</span>

            <span class="nx">switch</span> <span class="o">(</span><span class="nx">dir</span><span class="o">)</span> <span class="o">{</span>
                <span class="nx">case</span> <span class="s1">&#39;down&#39;</span><span class="o">:</span>
                    <span class="nx">t</span> <span class="o">=</span> <span class="o">-(</span><span class="nx">inc</span><span class="o">);</span>
                    <span class="k">if</span> <span class="o">((</span><span class="nx">region</span><span class="o">.</span><span class="nx">bottom</span> <span class="o">-</span> <span class="nx">inc</span><span class="o">)</span> <span class="o">&lt;</span> <span class="m">0</span><span class="o">)</span> <span class="o">{</span>
                        <span class="nx">resize</span> <span class="o">=</span> <span class="kc">false</span><span class="o">;</span>
                        <span class="k">this</span><span class="o">.</span><span class="nx">_resizeEl</span><span class="o">.</span><span class="nx">style</span><span class="o">.</span><span class="nx">top</span> <span class="o">=</span> <span class="o">(</span><span class="nx">region</span><span class="o">.</span><span class="nx">top</span> <span class="o">+</span> <span class="nx">region</span><span class="o">.</span><span class="nx">bottom</span><span class="o">)</span> <span class="o">+</span> <span class="s1">&#39;px&#39;</span><span class="o">;</span>
                    <span class="o">}</span>
                    <span class="k">break</span><span class="o">;</span>
                <span class="nx">case</span> <span class="s1">&#39;up&#39;</span><span class="o">:</span>
                    <span class="nx">t</span> <span class="o">=</span> <span class="o">(</span><span class="nx">inc</span><span class="o">);</span>
                    <span class="k">if</span> <span class="o">((</span><span class="nx">region</span><span class="o">.</span><span class="nx">top</span> <span class="o">-</span> <span class="nx">inc</span><span class="o">)</span> <span class="o">&lt;</span> <span class="m">0</span><span class="o">)</span> <span class="o">{</span>
                        <span class="nx">resize</span> <span class="o">=</span> <span class="kc">false</span><span class="o">;</span>
                        <span class="k">this</span><span class="o">.</span><span class="nx">_resizeEl</span><span class="o">.</span><span class="nx">style</span><span class="o">.</span><span class="nx">top</span> <span class="o">=</span> <span class="s1">&#39;0px&#39;</span><span class="o">;</span>
                    <span class="o">}</span>
                    <span class="k">break</span><span class="o">;</span>
                <span class="nx">case</span> <span class="s1">&#39;right&#39;</span><span class="o">:</span>
                    <span class="nx">l</span> <span class="o">=</span> <span class="o">-(</span><span class="nx">inc</span><span class="o">);</span>
                    <span class="k">if</span> <span class="o">((</span><span class="nx">region</span><span class="o">.</span><span class="nx">right</span> <span class="o">-</span> <span class="nx">inc</span><span class="o">)</span> <span class="o">&lt;</span> <span class="m">0</span><span class="o">)</span> <span class="o">{</span>
                        <span class="nx">resize</span> <span class="o">=</span> <span class="kc">false</span><span class="o">;</span>
                        <span class="k">this</span><span class="o">.</span><span class="nx">_resizeEl</span><span class="o">.</span><span class="nx">style</span><span class="o">.</span><span class="nx">left</span> <span class="o">=</span> <span class="o">(</span><span class="nx">region</span><span class="o">.</span><span class="nx">left</span> <span class="o">+</span> <span class="nx">region</span><span class="o">.</span><span class="nx">right</span><span class="o">)</span> <span class="o">+</span> <span class="s1">&#39;px&#39;</span><span class="o">;</span>
                    <span class="o">}</span>
                    <span class="k">break</span><span class="o">;</span>
                <span class="nx">case</span> <span class="s1">&#39;left&#39;</span><span class="o">:</span>
                    <span class="nx">l</span> <span class="o">=</span> <span class="nx">inc</span><span class="o">;</span>
                    <span class="k">if</span> <span class="o">((</span><span class="nx">region</span><span class="o">.</span><span class="nx">left</span> <span class="o">-</span> <span class="nx">inc</span><span class="o">)</span> <span class="o">&lt;</span> <span class="m">0</span><span class="o">)</span> <span class="o">{</span>
                        <span class="nx">resize</span> <span class="o">=</span> <span class="kc">false</span><span class="o">;</span>
                        <span class="k">this</span><span class="o">.</span><span class="nx">_resizeEl</span><span class="o">.</span><span class="nx">style</span><span class="o">.</span><span class="nx">left</span> <span class="o">=</span> <span class="s1">&#39;0px&#39;</span><span class="o">;</span>
                    <span class="o">}</span>
                    <span class="k">break</span><span class="o">;</span>
            <span class="o">}</span>

            <span class="k">if</span> <span class="o">(</span><span class="nx">resize</span><span class="o">)</span> <span class="o">{</span>
                <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">log</span><span class="o">(</span><span class="s1">&#39;Moving via Key Listener: &#39;</span> <span class="o">+</span> <span class="nx">dir</span><span class="o">,</span> <span class="s1">&#39;log&#39;</span><span class="o">,</span> <span class="s1">&#39;ImageCropper&#39;</span><span class="o">);</span>
                <span class="k">this</span><span class="o">.</span><span class="nx">_resizeEl</span><span class="o">.</span><span class="nx">style</span><span class="o">.</span><span class="nx">left</span> <span class="o">=</span> <span class="o">(</span><span class="nb">parseInt</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">_resizeEl</span><span class="o">.</span><span class="nx">style</span><span class="o">.</span><span class="nx">left</span><span class="o">,</span> <span class="m">10</span><span class="o">)</span> <span class="o">-</span> <span class="nx">l</span><span class="o">)</span> <span class="o">+</span> <span class="s1">&#39;px&#39;</span><span class="o">;</span>
                <span class="k">this</span><span class="o">.</span><span class="nx">_resizeEl</span><span class="o">.</span><span class="nx">style</span><span class="o">.</span><span class="nx">top</span> <span class="o">=</span> <span class="o">(</span><span class="nb">parseInt</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">_resizeEl</span><span class="o">.</span><span class="nx">style</span><span class="o">.</span><span class="nx">top</span><span class="o">,</span> <span class="m">10</span><span class="o">)</span> <span class="o">-</span> <span class="nx">t</span><span class="o">)</span> <span class="o">+</span> <span class="s1">&#39;px&#39;</span><span class="o">;</span>
                <span class="k">this</span><span class="o">.</span><span class="nx">fireEvent</span><span class="o">(</span><span class="s1">&#39;moveEvent&#39;</span><span class="o">,</span> <span class="o">{</span> <span class="nx">target</span><span class="o">:</span> <span class="s1">&#39;keypress&#39;</span> <span class="o">});</span>
            <span class="o">}</span> <span class="k">else</span> <span class="o">{</span>
                <span class="k">this</span><span class="o">.</span><span class="nx">_setConstraints</span><span class="o">();</span>
            <span class="o">}</span>
            <span class="k">this</span><span class="o">.</span><span class="nx">_syncBackgroundPosition</span><span class="o">();</span>
        <span class="o">},</span>

        <span class="c">/**</span>
<span class="c">        * @private</span>
<span class="c">        * @method _handleKeyPress</span>
<span class="c">        * @description Handles the keypress event</span>
<span class="c">        */</span>
        <span class="nx">_handleKeyPress</span><span class="o">:</span> <span class="k">function</span><span class="o">(</span><span class="nx">ev</span><span class="o">)</span> <span class="o">{</span>
            <span class="k">var</span> <span class="nx">kc</span> <span class="o">=</span> <span class="nx">Event</span><span class="o">.</span><span class="nx">getCharCode</span><span class="o">(</span><span class="nx">ev</span><span class="o">),</span>
                <span class="nx">stopEvent</span> <span class="o">=</span> <span class="kc">false</span><span class="o">,</span>
                <span class="nx">inc</span> <span class="o">=</span> <span class="o">((</span><span class="nx">ev</span><span class="o">.</span><span class="nx">shiftKey</span><span class="o">)</span> <span class="o">?</span> <span class="k">this</span><span class="o">.</span><span class="nx">get</span><span class="o">(</span><span class="s1">&#39;shiftKeyTick&#39;</span><span class="o">)</span> <span class="o">:</span> <span class="k">this</span><span class="o">.</span><span class="nx">get</span><span class="o">(</span><span class="s1">&#39;keyTick&#39;</span><span class="o">));</span>

            <span class="nx">switch</span> <span class="o">(</span><span class="nx">kc</span><span class="o">)</span> <span class="o">{</span>
                <span class="nx">case</span> <span class="m">0</span><span class="nx">x25</span><span class="o">:</span> <span class="c">// left</span>
<span class="c"></span>                    <span class="k">this</span><span class="o">.</span><span class="nx">_moveEl</span><span class="o">(</span><span class="s1">&#39;left&#39;</span><span class="o">,</span> <span class="nx">inc</span><span class="o">);</span>
                    <span class="nx">stopEvent</span> <span class="o">=</span> <span class="kc">true</span><span class="o">;</span>
                    <span class="k">break</span><span class="o">;</span>
                <span class="nx">case</span> <span class="m">0</span><span class="nx">x26</span><span class="o">:</span> <span class="c">// up</span>
<span class="c"></span>                    <span class="k">this</span><span class="o">.</span><span class="nx">_moveEl</span><span class="o">(</span><span class="s1">&#39;up&#39;</span><span class="o">,</span> <span class="nx">inc</span><span class="o">);</span>
                    <span class="nx">stopEvent</span> <span class="o">=</span> <span class="kc">true</span><span class="o">;</span>
                    <span class="k">break</span><span class="o">;</span>
                <span class="nx">case</span> <span class="m">0</span><span class="nx">x27</span><span class="o">:</span> <span class="c">// right</span>
<span class="c"></span>                    <span class="k">this</span><span class="o">.</span><span class="nx">_moveEl</span><span class="o">(</span><span class="s1">&#39;right&#39;</span><span class="o">,</span> <span class="nx">inc</span><span class="o">);</span>
                    <span class="nx">stopEvent</span> <span class="o">=</span> <span class="kc">true</span><span class="o">;</span>
                    <span class="k">break</span><span class="o">;</span>
                <span class="nx">case</span> <span class="m">0</span><span class="nx">x28</span><span class="o">:</span> <span class="c">// down</span>
<span class="c"></span>                    <span class="k">this</span><span class="o">.</span><span class="nx">_moveEl</span><span class="o">(</span><span class="s1">&#39;down&#39;</span><span class="o">,</span> <span class="nx">inc</span><span class="o">);</span>
                    <span class="nx">stopEvent</span> <span class="o">=</span> <span class="kc">true</span><span class="o">;</span>
                    <span class="k">break</span><span class="o">;</span>
                <span class="nx">default</span><span class="o">:</span>
            <span class="o">}</span>
            <span class="k">if</span> <span class="o">(</span><span class="nx">stopEvent</span><span class="o">)</span> <span class="o">{</span>
                <span class="nx">Event</span><span class="o">.</span><span class="nx">preventDefault</span><span class="o">(</span><span class="nx">ev</span><span class="o">);</span>
            <span class="o">}</span>
        <span class="o">},</span>

        <span class="c">/**</span>
<span class="c">        * @private</span>
<span class="c">        * @method _handleB4DragEvent</span>
<span class="c">        * @description Handles the DragDrop b4DragEvent event</span>
<span class="c">        */</span>
        <span class="nx">_handleB4DragEvent</span><span class="o">:</span> <span class="k">function</span><span class="o">()</span> <span class="o">{</span>
            <span class="k">this</span><span class="o">.</span><span class="nx">_setConstraints</span><span class="o">();</span>
        <span class="o">},</span>

        <span class="c">/**</span>
<span class="c">        * @private</span>
<span class="c">        * @method _handleDragEvent</span>
<span class="c">        * @description Handles the DragDrop DragEvent event</span>
<span class="c">        */</span>
        <span class="nx">_handleDragEvent</span><span class="o">:</span> <span class="k">function</span><span class="o">()</span> <span class="o">{</span>
            <span class="k">this</span><span class="o">.</span><span class="nx">_syncBackgroundPosition</span><span class="o">();</span>
            <span class="k">this</span><span class="o">.</span><span class="nx">fireEvent</span><span class="o">(</span><span class="s1">&#39;dragEvent&#39;</span><span class="o">,</span> <span class="nx">arguments</span><span class="o">);</span>
            <span class="k">this</span><span class="o">.</span><span class="nx">fireEvent</span><span class="o">(</span><span class="s1">&#39;moveEvent&#39;</span><span class="o">,</span> <span class="o">{</span> <span class="nx">target</span><span class="o">:</span> <span class="s1">&#39;dragevent&#39;</span> <span class="o">});</span>
        <span class="o">},</span>

        <span class="c">/**</span>
<span class="c">        * @private</span>
<span class="c">        * @method _handleBeforeResizeEvent</span>
<span class="c">        * @description Handles the Resize Utilitys beforeResize event</span>
<span class="c">        */</span>
        <span class="nx">_handleBeforeResizeEvent</span><span class="o">:</span> <span class="k">function</span><span class="o">(</span><span class="nx">args</span><span class="o">)</span> <span class="o">{</span>
            <span class="k">var</span> <span class="nx">region</span> <span class="o">=</span> <span class="nx">Dom</span><span class="o">.</span><span class="nx">getRegion</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">get</span><span class="o">(</span><span class="s1">&#39;element&#39;</span><span class="o">)),</span>
                <span class="nx">c</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">_resize</span><span class="o">.</span><span class="nx">_cache</span><span class="o">,</span>
                <span class="nx">ch</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">_resize</span><span class="o">.</span><span class="nx">_currentHandle</span><span class="o">,</span> <span class="nx">h</span> <span class="o">=</span> <span class="m">0</span><span class="o">,</span> <span class="nx">w</span> <span class="o">=</span> <span class="m">0</span><span class="o">;</span>

            <span class="k">if</span> <span class="o">(</span><span class="nx">args</span><span class="o">.</span><span class="nx">top</span> <span class="o">&amp;&amp;</span> <span class="o">(</span><span class="nx">args</span><span class="o">.</span><span class="nx">top</span> <span class="o">&lt;</span> <span class="nx">region</span><span class="o">.</span><span class="nx">top</span><span class="o">))</span> <span class="o">{</span>
                <span class="nx">h</span> <span class="o">=</span> <span class="o">(</span><span class="nx">c</span><span class="o">.</span><span class="nx">height</span> <span class="o">+</span> <span class="nx">c</span><span class="o">.</span><span class="nx">top</span><span class="o">)</span> <span class="o">-</span> <span class="nx">region</span><span class="o">.</span><span class="nx">top</span><span class="o">;</span>
                <span class="nx">Dom</span><span class="o">.</span><span class="nx">setY</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">_resize</span><span class="o">.</span><span class="nx">getWrapEl</span><span class="o">(),</span> <span class="nx">region</span><span class="o">.</span><span class="nx">top</span><span class="o">);</span>
                <span class="k">this</span><span class="o">.</span><span class="nx">_resize</span><span class="o">.</span><span class="nx">getWrapEl</span><span class="o">().</span><span class="nx">style</span><span class="o">.</span><span class="nx">height</span> <span class="o">=</span> <span class="nx">h</span> <span class="o">+</span> <span class="s1">&#39;px&#39;</span><span class="o">;</span>
                <span class="k">this</span><span class="o">.</span><span class="nx">_resize</span><span class="o">.</span><span class="nx">_cache</span><span class="o">.</span><span class="nx">height</span> <span class="o">=</span> <span class="nx">h</span><span class="o">;</span>
                <span class="k">this</span><span class="o">.</span><span class="nx">_resize</span><span class="o">.</span><span class="nx">_cache</span><span class="o">.</span><span class="nx">top</span> <span class="o">=</span> <span class="nx">region</span><span class="o">.</span><span class="nx">top</span><span class="o">;</span>
                <span class="k">this</span><span class="o">.</span><span class="nx">_syncBackgroundPosition</span><span class="o">();</span>
                <span class="k">return</span> <span class="kc">false</span><span class="o">;</span>
            <span class="o">}</span>
            <span class="k">if</span> <span class="o">(</span><span class="nx">args</span><span class="o">.</span><span class="nx">left</span> <span class="o">&amp;&amp;</span> <span class="o">(</span><span class="nx">args</span><span class="o">.</span><span class="nx">left</span> <span class="o">&lt;</span> <span class="nx">region</span><span class="o">.</span><span class="nx">left</span><span class="o">))</span> <span class="o">{</span>
                <span class="nx">w</span> <span class="o">=</span> <span class="o">(</span><span class="nx">c</span><span class="o">.</span><span class="nx">width</span> <span class="o">+</span> <span class="nx">c</span><span class="o">.</span><span class="nx">left</span><span class="o">)</span> <span class="o">-</span> <span class="nx">region</span><span class="o">.</span><span class="nx">left</span><span class="o">;</span>
                <span class="nx">Dom</span><span class="o">.</span><span class="nx">setX</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">_resize</span><span class="o">.</span><span class="nx">getWrapEl</span><span class="o">(),</span> <span class="nx">region</span><span class="o">.</span><span class="nx">left</span><span class="o">);</span>
                <span class="k">this</span><span class="o">.</span><span class="nx">_resize</span><span class="o">.</span><span class="nx">_cache</span><span class="o">.</span><span class="nx">left</span> <span class="o">=</span> <span class="nx">region</span><span class="o">.</span><span class="nx">left</span><span class="o">;</span>
                <span class="k">this</span><span class="o">.</span><span class="nx">_resize</span><span class="o">.</span><span class="nx">getWrapEl</span><span class="o">().</span><span class="nx">style</span><span class="o">.</span><span class="nx">width</span> <span class="o">=</span> <span class="nx">w</span> <span class="o">+</span> <span class="s1">&#39;px&#39;</span><span class="o">;</span>
                <span class="k">this</span><span class="o">.</span><span class="nx">_resize</span><span class="o">.</span><span class="nx">_cache</span><span class="o">.</span><span class="nx">width</span> <span class="o">=</span> <span class="nx">w</span><span class="o">;</span>
                <span class="k">this</span><span class="o">.</span><span class="nx">_syncBackgroundPosition</span><span class="o">();</span>
                <span class="k">return</span> <span class="kc">false</span><span class="o">;</span>
            <span class="o">}</span>
            <span class="k">if</span> <span class="o">(</span><span class="nx">ch</span> <span class="o">!=</span> <span class="s1">&#39;tl&#39;</span> <span class="o">&amp;&amp;</span> <span class="nx">ch</span> <span class="o">!=</span> <span class="s1">&#39;l&#39;</span> <span class="o">&amp;&amp;</span> <span class="nx">ch</span> <span class="o">!=</span> <span class="s1">&#39;bl&#39;</span><span class="o">)</span> <span class="o">{</span>
                <span class="k">if</span> <span class="o">(</span><span class="nx">c</span><span class="o">.</span><span class="nx">left</span> <span class="o">&amp;&amp;</span> <span class="nx">args</span><span class="o">.</span><span class="nx">width</span> <span class="o">&amp;&amp;</span> <span class="o">((</span><span class="nx">c</span><span class="o">.</span><span class="nx">left</span> <span class="o">+</span> <span class="nx">args</span><span class="o">.</span><span class="nx">width</span><span class="o">)</span> <span class="o">&gt;</span> <span class="nx">region</span><span class="o">.</span><span class="nx">right</span><span class="o">))</span> <span class="o">{</span>
                    <span class="nx">w</span> <span class="o">=</span> <span class="o">(</span><span class="nx">region</span><span class="o">.</span><span class="nx">right</span> <span class="o">-</span> <span class="nx">c</span><span class="o">.</span><span class="nx">left</span><span class="o">);</span>
                    <span class="nx">Dom</span><span class="o">.</span><span class="nx">setX</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">_resize</span><span class="o">.</span><span class="nx">getWrapEl</span><span class="o">(),</span> <span class="o">(</span><span class="nx">region</span><span class="o">.</span><span class="nx">right</span> <span class="o">-</span> <span class="nx">w</span><span class="o">));</span>
                    <span class="k">this</span><span class="o">.</span><span class="nx">_resize</span><span class="o">.</span><span class="nx">getWrapEl</span><span class="o">().</span><span class="nx">style</span><span class="o">.</span><span class="nx">width</span> <span class="o">=</span> <span class="nx">w</span> <span class="o">+</span> <span class="s1">&#39;px&#39;</span><span class="o">;</span>
                    <span class="k">this</span><span class="o">.</span><span class="nx">_resize</span><span class="o">.</span><span class="nx">_cache</span><span class="o">.</span><span class="nx">left</span> <span class="o">=</span> <span class="o">(</span><span class="nx">region</span><span class="o">.</span><span class="nx">right</span> <span class="o">-</span> <span class="nx">w</span><span class="o">);</span>
                    <span class="k">this</span><span class="o">.</span><span class="nx">_resize</span><span class="o">.</span><span class="nx">_cache</span><span class="o">.</span><span class="nx">width</span> <span class="o">=</span> <span class="nx">w</span><span class="o">;</span>
                    <span class="k">this</span><span class="o">.</span><span class="nx">_syncBackgroundPosition</span><span class="o">();</span>
                    <span class="k">return</span> <span class="kc">false</span><span class="o">;</span>
                <span class="o">}</span>
            <span class="o">}</span>
            <span class="k">if</span> <span class="o">(</span><span class="nx">ch</span> <span class="o">!=</span> <span class="s1">&#39;t&#39;</span> <span class="o">&amp;&amp;</span> <span class="nx">ch</span> <span class="o">!=</span> <span class="s1">&#39;tr&#39;</span> <span class="o">&amp;&amp;</span> <span class="nx">ch</span> <span class="o">!=</span> <span class="s1">&#39;tl&#39;</span><span class="o">)</span> <span class="o">{</span>
                <span class="k">if</span> <span class="o">(</span><span class="nx">c</span><span class="o">.</span><span class="nx">top</span> <span class="o">&amp;&amp;</span> <span class="nx">args</span><span class="o">.</span><span class="nx">height</span> <span class="o">&amp;&amp;</span> <span class="o">((</span><span class="nx">c</span><span class="o">.</span><span class="nx">top</span> <span class="o">+</span> <span class="nx">args</span><span class="o">.</span><span class="nx">height</span><span class="o">)</span> <span class="o">&gt;</span> <span class="nx">region</span><span class="o">.</span><span class="nx">bottom</span><span class="o">))</span> <span class="o">{</span>
                    <span class="nx">h</span> <span class="o">=</span> <span class="o">(</span><span class="nx">region</span><span class="o">.</span><span class="nx">bottom</span> <span class="o">-</span> <span class="nx">c</span><span class="o">.</span><span class="nx">top</span><span class="o">);</span>
                    <span class="nx">Dom</span><span class="o">.</span><span class="nx">setY</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">_resize</span><span class="o">.</span><span class="nx">getWrapEl</span><span class="o">(),</span> <span class="o">(</span><span class="nx">region</span><span class="o">.</span><span class="nx">bottom</span> <span class="o">-</span> <span class="nx">h</span><span class="o">));</span>
                    <span class="k">this</span><span class="o">.</span><span class="nx">_resize</span><span class="o">.</span><span class="nx">getWrapEl</span><span class="o">().</span><span class="nx">style</span><span class="o">.</span><span class="nx">height</span> <span class="o">=</span> <span class="nx">h</span> <span class="o">+</span> <span class="s1">&#39;px&#39;</span><span class="o">;</span>
                    <span class="k">this</span><span class="o">.</span><span class="nx">_resize</span><span class="o">.</span><span class="nx">_cache</span><span class="o">.</span><span class="nx">height</span> <span class="o">=</span> <span class="nx">h</span><span class="o">;</span>
                    <span class="k">this</span><span class="o">.</span><span class="nx">_resize</span><span class="o">.</span><span class="nx">_cache</span><span class="o">.</span><span class="nx">top</span> <span class="o">=</span> <span class="o">(</span><span class="nx">region</span><span class="o">.</span><span class="nx">bottom</span> <span class="o">-</span> <span class="nx">h</span><span class="o">);</span>
                    <span class="k">this</span><span class="o">.</span><span class="nx">_syncBackgroundPosition</span><span class="o">();</span>
                    <span class="k">return</span> <span class="kc">false</span><span class="o">;</span>
                <span class="o">}</span>
            <span class="o">}</span>
        <span class="o">},</span>
        <span class="c">/**</span>
<span class="c">        * @private</span>
<span class="c">        * @method _handleResizeMaskEl</span>
<span class="c">        * @description Resizes the inner mask element</span>
<span class="c">        */</span>
        <span class="nx">_handleResizeMaskEl</span><span class="o">:</span> <span class="k">function</span><span class="o">()</span> <span class="o">{</span>
            <span class="k">var</span> <span class="nx">a</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">_resize</span><span class="o">.</span><span class="nx">_cache</span><span class="o">;</span>
            <span class="k">this</span><span class="o">.</span><span class="nx">_resizeMaskEl</span><span class="o">.</span><span class="nx">style</span><span class="o">.</span><span class="nx">height</span> <span class="o">=</span> <span class="nb">Math</span><span class="o">.</span><span class="nx">floor</span><span class="o">(</span><span class="nx">a</span><span class="o">.</span><span class="nx">height</span><span class="o">)</span> <span class="o">+</span> <span class="s1">&#39;px&#39;</span><span class="o">;</span>
            <span class="k">this</span><span class="o">.</span><span class="nx">_resizeMaskEl</span><span class="o">.</span><span class="nx">style</span><span class="o">.</span><span class="nx">width</span> <span class="o">=</span> <span class="nb">Math</span><span class="o">.</span><span class="nx">floor</span><span class="o">(</span><span class="nx">a</span><span class="o">.</span><span class="nx">width</span><span class="o">)</span> <span class="o">+</span> <span class="s1">&#39;px&#39;</span><span class="o">;</span>
        <span class="o">},</span>
        <span class="c">/**</span>
<span class="c">        * @private</span>
<span class="c">        * @method _handleResizeEvent</span>
<span class="c">        * @param Event ev The Resize Utilitys resize event.</span>
<span class="c">        * @description Handles the Resize Utilitys Resize event</span>
<span class="c">        */</span>
        <span class="nx">_handleResizeEvent</span><span class="o">:</span> <span class="k">function</span><span class="o">(</span><span class="nx">ev</span><span class="o">)</span> <span class="o">{</span>
            <span class="k">this</span><span class="o">.</span><span class="nx">_setConstraints</span><span class="o">(</span><span class="kc">true</span><span class="o">);</span>
            <span class="k">this</span><span class="o">.</span><span class="nx">_syncBackgroundPosition</span><span class="o">();</span>
            <span class="k">this</span><span class="o">.</span><span class="nx">fireEvent</span><span class="o">(</span><span class="s1">&#39;resizeEvent&#39;</span><span class="o">,</span> <span class="nx">arguments</span><span class="o">);</span>
            <span class="k">this</span><span class="o">.</span><span class="nx">fireEvent</span><span class="o">(</span><span class="s1">&#39;moveEvent&#39;</span><span class="o">,</span> <span class="o">{</span> <span class="nx">target</span><span class="o">:</span> <span class="s1">&#39;resizeevent&#39;</span> <span class="o">});</span>
        <span class="o">},</span>

        <span class="c">/**</span>
<span class="c">        * @private</span>
<span class="c">        * @method _syncBackgroundPosition</span>
<span class="c">        * @description Syncs the packground position of the resize element with the resize elements top and left style position</span>
<span class="c">        */</span>
        <span class="nx">_syncBackgroundPosition</span><span class="o">:</span> <span class="k">function</span><span class="o">()</span> <span class="o">{</span>
            <span class="k">this</span><span class="o">.</span><span class="nx">_handleResizeMaskEl</span><span class="o">();</span>
            <span class="k">this</span><span class="o">.</span><span class="nx">_setBackgroundPosition</span><span class="o">(-(</span><span class="nb">parseInt</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">_resizeEl</span><span class="o">.</span><span class="nx">style</span><span class="o">.</span><span class="nx">left</span><span class="o">,</span> <span class="m">10</span><span class="o">)),</span> <span class="o">-(</span><span class="nb">parseInt</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">_resizeEl</span><span class="o">.</span><span class="nx">style</span><span class="o">.</span><span class="nx">top</span><span class="o">,</span> <span class="m">10</span><span class="o">)));</span>
        <span class="o">},</span>

        <span class="c">/**</span>
<span class="c">        * @private</span>
<span class="c">        * @method _setBackgroundPosition</span>
<span class="c">        * @param Number l The left position</span>
<span class="c">        * @param Number t The top position</span>
<span class="c">        * @description Sets the background image position to the top and left position</span>
<span class="c">        */</span>
        <span class="nx">_setBackgroundPosition</span><span class="o">:</span> <span class="k">function</span><span class="o">(</span><span class="nx">l</span><span class="o">,</span> <span class="nx">t</span><span class="o">)</span> <span class="o">{</span>
            <span class="c">//YAHOO.log(&#39;Setting the image background position of the mask to: (&#39; + l + &#39;, &#39; + t + &#39;)&#39;, &#39;log&#39;, &#39;ImageCropper&#39;);</span>
<span class="c"></span>            <span class="k">var</span> <span class="nx">bl</span> <span class="o">=</span> <span class="nb">parseInt</span><span class="o">(</span><span class="nx">Dom</span><span class="o">.</span><span class="nx">getStyle</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">_resize</span><span class="o">.</span><span class="nx">get</span><span class="o">(</span><span class="s1">&#39;element&#39;</span><span class="o">),</span> <span class="s1">&#39;borderLeftWidth&#39;</span><span class="o">),</span> <span class="m">10</span><span class="o">);</span>
            <span class="k">var</span> <span class="nx">bt</span> <span class="o">=</span> <span class="nb">parseInt</span><span class="o">(</span><span class="nx">Dom</span><span class="o">.</span><span class="nx">getStyle</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">_resize</span><span class="o">.</span><span class="nx">get</span><span class="o">(</span><span class="s1">&#39;element&#39;</span><span class="o">),</span> <span class="s1">&#39;borderTopWidth&#39;</span><span class="o">),</span> <span class="m">10</span><span class="o">);</span>
            <span class="k">if</span> <span class="o">(</span><span class="nb">isNaN</span><span class="o">(</span><span class="nx">bl</span><span class="o">))</span> <span class="o">{</span>
                <span class="nx">bl</span> <span class="o">=</span> <span class="m">0</span><span class="o">;</span>
            <span class="o">}</span>
            <span class="k">if</span> <span class="o">(</span><span class="nb">isNaN</span><span class="o">(</span><span class="nx">bt</span><span class="o">))</span> <span class="o">{</span>
                <span class="nx">bt</span> <span class="o">=</span> <span class="m">0</span><span class="o">;</span>
            <span class="o">}</span>
            <span class="k">var</span> <span class="nx">mask</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">_resize</span><span class="o">.</span><span class="nx">getWrapEl</span><span class="o">().</span><span class="nx">firstChild</span><span class="o">;</span>
            <span class="k">var</span> <span class="nx">pos</span> <span class="o">=</span> <span class="o">(</span><span class="nx">l</span> <span class="o">-</span> <span class="nx">bl</span><span class="o">)</span> <span class="o">+</span> <span class="s1">&#39;px &#39;</span> <span class="o">+</span> <span class="o">(</span><span class="nx">t</span> <span class="o">-</span> <span class="nx">bt</span><span class="o">)</span> <span class="o">+</span> <span class="s1">&#39;px&#39;</span><span class="o">;</span>
            <span class="k">this</span><span class="o">.</span><span class="nx">_resizeMaskEl</span><span class="o">.</span><span class="nx">style</span><span class="o">.</span><span class="nx">backgroundPosition</span> <span class="o">=</span> <span class="nx">pos</span><span class="o">;</span>
        <span class="o">},</span>

        <span class="c">/**</span>
<span class="c">        * @private</span>
<span class="c">        * @method _setBackgroundImage</span>
<span class="c">        * @param String url The url of the image</span>
<span class="c">        * @description Sets the background image of the resize element</span>
<span class="c">        */</span>
        <span class="nx">_setBackgroundImage</span><span class="o">:</span> <span class="k">function</span><span class="o">(</span><span class="nx">url</span><span class="o">)</span> <span class="o">{</span>
            <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">log</span><span class="o">(</span><span class="s1">&#39;Setting the background image&#39;</span><span class="o">,</span> <span class="s1">&#39;log&#39;</span><span class="o">,</span> <span class="s1">&#39;ImageCropper&#39;</span><span class="o">);</span>
            <span class="k">var</span> <span class="nx">mask</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">_resize</span><span class="o">.</span><span class="nx">getWrapEl</span><span class="o">().</span><span class="nx">firstChild</span><span class="o">;</span>
            <span class="k">this</span><span class="o">.</span><span class="nx">_image</span> <span class="o">=</span> <span class="nx">url</span><span class="o">;</span>
            <span class="nx">mask</span><span class="o">.</span><span class="nx">style</span><span class="o">.</span><span class="nx">backgroundImage</span> <span class="o">=</span> <span class="s1">&#39;url(&#39;</span> <span class="o">+</span> <span class="nx">url</span> <span class="o">+</span> <span class="s1">&#39;#)&#39;</span><span class="o">;</span>
        <span class="o">},</span>
        
        <span class="c">/**</span>
<span class="c">        * @private</span>
<span class="c">        * @method _handleEndResizeEvent</span>
<span class="c">        * @description Handles the Resize Utilitys endResize event</span>
<span class="c">        */</span>
        <span class="nx">_handleEndResizeEvent</span><span class="o">:</span> <span class="k">function</span><span class="o">()</span> <span class="o">{</span>
            <span class="k">this</span><span class="o">.</span><span class="nx">_setConstraints</span><span class="o">(</span><span class="kc">true</span><span class="o">);</span>
        <span class="o">},</span>
        <span class="c">/**</span>
<span class="c">        * @private</span>
<span class="c">        * @method _handleStartResizeEvent</span>
<span class="c">        * @description Handles the Resize Utilitys startResize event</span>
<span class="c">        */</span>
        <span class="nx">_handleStartResizeEvent</span><span class="o">:</span> <span class="k">function</span><span class="o">()</span> <span class="o">{</span>
            <span class="k">this</span><span class="o">.</span><span class="nx">_setConstraints</span><span class="o">(</span><span class="kc">true</span><span class="o">);</span>

            <span class="k">var</span> <span class="nx">h</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">_resize</span><span class="o">.</span><span class="nx">_cache</span><span class="o">.</span><span class="nx">height</span><span class="o">,</span>
                 <span class="nx">w</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">_resize</span><span class="o">.</span><span class="nx">_cache</span><span class="o">.</span><span class="nx">width</span><span class="o">,</span>
                 <span class="nx">t</span> <span class="o">=</span> <span class="nb">parseInt</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">_resize</span><span class="o">.</span><span class="nx">getWrapEl</span><span class="o">().</span><span class="nx">style</span><span class="o">.</span><span class="nx">top</span><span class="o">,</span> <span class="m">10</span><span class="o">),</span>
                 <span class="nx">l</span> <span class="o">=</span> <span class="nb">parseInt</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">_resize</span><span class="o">.</span><span class="nx">getWrapEl</span><span class="o">().</span><span class="nx">style</span><span class="o">.</span><span class="nx">left</span><span class="o">,</span> <span class="m">10</span><span class="o">),</span>
                 <span class="nx">maxH</span> <span class="o">=</span> <span class="m">0</span><span class="o">,</span> <span class="nx">maxW</span> <span class="o">=</span> <span class="m">0</span><span class="o">;</span>
 
            <span class="nx">switch</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">_resize</span><span class="o">.</span><span class="nx">_currentHandle</span><span class="o">)</span> <span class="o">{</span>
                <span class="nx">case</span> <span class="s1">&#39;b&#39;</span><span class="o">:</span>
                    <span class="nx">maxH</span> <span class="o">=</span> <span class="o">(</span><span class="nx">h</span> <span class="o">+</span> <span class="k">this</span><span class="o">.</span><span class="nx">_resize</span><span class="o">.</span><span class="nx">dd</span><span class="o">.</span><span class="nx">bottomConstraint</span><span class="o">);</span>
                    <span class="k">break</span><span class="o">;</span>
                <span class="nx">case</span> <span class="s1">&#39;l&#39;</span><span class="o">:</span>
                    <span class="nx">maxW</span> <span class="o">=</span> <span class="o">(</span><span class="nx">w</span> <span class="o">+</span> <span class="k">this</span><span class="o">.</span><span class="nx">_resize</span><span class="o">.</span><span class="nx">dd</span><span class="o">.</span><span class="nx">leftConstraint</span><span class="o">);</span>
                    <span class="k">break</span><span class="o">;</span>
                <span class="nx">case</span> <span class="s1">&#39;r&#39;</span><span class="o">:</span>
                    <span class="nx">maxH</span> <span class="o">=</span> <span class="o">(</span><span class="nx">h</span> <span class="o">+</span> <span class="nx">t</span><span class="o">);</span>
                    <span class="nx">maxW</span> <span class="o">=</span> <span class="o">(</span><span class="nx">w</span> <span class="o">+</span> <span class="k">this</span><span class="o">.</span><span class="nx">_resize</span><span class="o">.</span><span class="nx">dd</span><span class="o">.</span><span class="nx">rightConstraint</span><span class="o">);</span>
                    <span class="k">break</span><span class="o">;</span>
                 <span class="nx">case</span> <span class="s1">&#39;br&#39;</span><span class="o">:</span>
                     <span class="nx">maxH</span> <span class="o">=</span> <span class="o">(</span><span class="nx">h</span> <span class="o">+</span> <span class="k">this</span><span class="o">.</span><span class="nx">_resize</span><span class="o">.</span><span class="nx">dd</span><span class="o">.</span><span class="nx">bottomConstraint</span><span class="o">);</span>
                     <span class="nx">maxW</span> <span class="o">=</span> <span class="o">(</span><span class="nx">w</span> <span class="o">+</span> <span class="k">this</span><span class="o">.</span><span class="nx">_resize</span><span class="o">.</span><span class="nx">dd</span><span class="o">.</span><span class="nx">rightConstraint</span><span class="o">);</span>
                     <span class="k">break</span><span class="o">;</span>
                 <span class="nx">case</span> <span class="s1">&#39;tr&#39;</span><span class="o">:</span>
                     <span class="nx">maxH</span> <span class="o">=</span> <span class="o">(</span><span class="nx">h</span> <span class="o">+</span> <span class="nx">t</span><span class="o">);</span>
                     <span class="nx">maxW</span> <span class="o">=</span> <span class="o">(</span><span class="nx">w</span> <span class="o">+</span> <span class="k">this</span><span class="o">.</span><span class="nx">_resize</span><span class="o">.</span><span class="nx">dd</span><span class="o">.</span><span class="nx">rightConstraint</span><span class="o">);</span>
                     <span class="k">break</span><span class="o">;</span>

             <span class="o">}</span>
            
             <span class="k">if</span> <span class="o">(</span><span class="nx">maxH</span><span class="o">)</span> <span class="o">{</span>
                <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">log</span><span class="o">(</span><span class="s1">&#39;Setting the maxHeight on the resize object to: &#39;</span> <span class="o">+</span> <span class="nx">maxH</span><span class="o">,</span> <span class="s1">&#39;log&#39;</span><span class="o">,</span> <span class="s1">&#39;ImageCropper&#39;</span><span class="o">);</span>
                 <span class="c">//this._resize.set(&#39;maxHeight&#39;, maxH);</span>
<span class="c"></span>             <span class="o">}</span>
             <span class="k">if</span> <span class="o">(</span><span class="nx">maxW</span><span class="o">)</span> <span class="o">{</span>
                <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">log</span><span class="o">(</span><span class="s1">&#39;Setting the maxWidth on the resize object to: &#39;</span> <span class="o">+</span> <span class="nx">maxW</span><span class="o">,</span> <span class="s1">&#39;log&#39;</span><span class="o">,</span> <span class="s1">&#39;ImageCropper&#39;</span><span class="o">);</span>
                 <span class="c">//this._resize.set(&#39;maxWidth&#39;, maxW);</span>
<span class="c"></span>             <span class="o">}</span>

            <span class="k">this</span><span class="o">.</span><span class="nx">fireEvent</span><span class="o">(</span><span class="s1">&#39;startResizeEvent&#39;</span><span class="o">,</span> <span class="nx">arguments</span><span class="o">);</span>
        <span class="o">},</span>
        
        <span class="c">/**</span>
<span class="c">        * @private</span>
<span class="c">        * @method _setConstraints</span>
<span class="c">        * @param Boolean inside Used when called from inside a resize event, false by default (dragging)</span>
<span class="c">        * @description Set the DragDrop constraints to keep the element inside the crop area.</span>
<span class="c">        * @return {Object} Object containing Top, Right, Bottom and Left constraints</span>
<span class="c">        */</span>
        <span class="nx">_setConstraints</span><span class="o">:</span> <span class="k">function</span><span class="o">(</span><span class="nx">inside</span><span class="o">)</span> <span class="o">{</span>
            <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">log</span><span class="o">(</span><span class="s1">&#39;Setting Contraints&#39;</span><span class="o">,</span> <span class="s1">&#39;log&#39;</span><span class="o">,</span> <span class="s1">&#39;ImageCropper&#39;</span><span class="o">);</span>
            <span class="k">var</span> <span class="nx">resize</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">_resize</span><span class="o">;</span>
            <span class="nx">resize</span><span class="o">.</span><span class="nx">dd</span><span class="o">.</span><span class="nx">resetConstraints</span><span class="o">();</span>
            <span class="k">var</span> <span class="nx">height</span> <span class="o">=</span> <span class="nb">parseInt</span><span class="o">(</span><span class="nx">resize</span><span class="o">.</span><span class="nx">get</span><span class="o">(</span><span class="s1">&#39;height&#39;</span><span class="o">),</span> <span class="m">10</span><span class="o">),</span>
                <span class="nx">width</span> <span class="o">=</span> <span class="nb">parseInt</span><span class="o">(</span><span class="nx">resize</span><span class="o">.</span><span class="nx">get</span><span class="o">(</span><span class="s1">&#39;width&#39;</span><span class="o">),</span> <span class="m">10</span><span class="o">);</span>
            <span class="k">if</span> <span class="o">(</span><span class="nx">inside</span><span class="o">)</span> <span class="o">{</span>
                <span class="c">//Called from inside the resize callback</span>
<span class="c"></span>                <span class="nx">height</span> <span class="o">=</span> <span class="nx">resize</span><span class="o">.</span><span class="nx">_cache</span><span class="o">.</span><span class="nx">height</span><span class="o">;</span>
                <span class="nx">width</span> <span class="o">=</span> <span class="nx">resize</span><span class="o">.</span><span class="nx">_cache</span><span class="o">.</span><span class="nx">width</span><span class="o">;</span>
            <span class="o">}</span>

            <span class="c">//Get the top, right, bottom and left positions</span>
<span class="c"></span>            <span class="k">var</span> <span class="nx">region</span> <span class="o">=</span> <span class="nx">Dom</span><span class="o">.</span><span class="nx">getRegion</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">get</span><span class="o">(</span><span class="s1">&#39;element&#39;</span><span class="o">));</span>
            <span class="c">//Get the element we are working on</span>
<span class="c"></span>            <span class="k">var</span> <span class="nx">el</span> <span class="o">=</span> <span class="nx">resize</span><span class="o">.</span><span class="nx">getWrapEl</span><span class="o">();</span>

            <span class="c">//Get the xy position of it</span>
<span class="c"></span>            <span class="k">var</span> <span class="nx">xy</span> <span class="o">=</span> <span class="nx">Dom</span><span class="o">.</span><span class="nx">getXY</span><span class="o">(</span><span class="nx">el</span><span class="o">);</span>

            <span class="c">//Set left to x minus left</span>
<span class="c"></span>            <span class="k">var</span> <span class="nx">left</span> <span class="o">=</span> <span class="nx">xy</span><span class="o">[</span><span class="m">0</span><span class="o">]</span> <span class="o">-</span> <span class="nx">region</span><span class="o">.</span><span class="nx">left</span><span class="o">;</span>

            <span class="c">//Set right to right minus x minus width</span>
<span class="c"></span>            <span class="k">var</span> <span class="nx">right</span> <span class="o">=</span> <span class="nx">region</span><span class="o">.</span><span class="nx">right</span> <span class="o">-</span> <span class="nx">xy</span><span class="o">[</span><span class="m">0</span><span class="o">]</span> <span class="o">-</span> <span class="nx">width</span><span class="o">;</span>

            <span class="c">//Set top to y minus top</span>
<span class="c"></span>            <span class="k">var</span> <span class="nx">top</span> <span class="o">=</span> <span class="nx">xy</span><span class="o">[</span><span class="m">1</span><span class="o">]</span> <span class="o">-</span> <span class="nx">region</span><span class="o">.</span><span class="nx">top</span><span class="o">;</span>

            <span class="c">//Set bottom to bottom minus y minus height</span>
<span class="c"></span>            <span class="k">var</span> <span class="nx">bottom</span> <span class="o">=</span> <span class="nx">region</span><span class="o">.</span><span class="nx">bottom</span> <span class="o">-</span> <span class="nx">xy</span><span class="o">[</span><span class="m">1</span><span class="o">]</span> <span class="o">-</span> <span class="nx">height</span><span class="o">;</span>

            <span class="k">if</span> <span class="o">(</span><span class="nx">top</span> <span class="o">&lt;</span> <span class="m">0</span><span class="o">)</span> <span class="o">{</span>
                <span class="nx">top</span> <span class="o">=</span> <span class="m">0</span><span class="o">;</span>
            <span class="o">}</span>
            
            <span class="nx">resize</span><span class="o">.</span><span class="nx">dd</span><span class="o">.</span><span class="nx">setXConstraint</span><span class="o">(</span><span class="nx">left</span><span class="o">,</span> <span class="nx">right</span><span class="o">);</span> 
            <span class="nx">resize</span><span class="o">.</span><span class="nx">dd</span><span class="o">.</span><span class="nx">setYConstraint</span><span class="o">(</span><span class="nx">top</span><span class="o">,</span> <span class="nx">bottom</span><span class="o">);</span>
            <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">log</span><span class="o">(</span><span class="s1">&#39;Constraints: &#39;</span> <span class="o">+</span> <span class="nx">top</span> <span class="o">+</span> <span class="s1">&#39;,&#39;</span> <span class="o">+</span> <span class="nx">right</span> <span class="o">+</span> <span class="s1">&#39;,&#39;</span> <span class="o">+</span> <span class="nx">bottom</span> <span class="o">+</span> <span class="s1">&#39;,&#39;</span> <span class="o">+</span> <span class="nx">left</span><span class="o">,</span> <span class="s1">&#39;log&#39;</span><span class="o">,</span> <span class="s1">&#39;ImageCropper&#39;</span><span class="o">);</span>

            <span class="k">return</span> <span class="o">{</span>
                <span class="nx">top</span><span class="o">:</span> <span class="nx">top</span><span class="o">,</span>
                <span class="nx">right</span><span class="o">:</span> <span class="nx">right</span><span class="o">,</span>
                <span class="nx">bottom</span><span class="o">:</span> <span class="nx">bottom</span><span class="o">,</span>
                <span class="nx">left</span><span class="o">:</span> <span class="nx">left</span>
            <span class="o">};</span>

            
            
        <span class="o">},</span>
        <span class="c">/**</span>
<span class="c">        * @method getCropCoords</span>
<span class="c">        * @description Returns the coordinates needed to crop the image</span>
<span class="c">        * @return {Object} The top, left, height, width and image url of the image being cropped</span>
<span class="c">        */</span>
        <span class="nx">getCropCoords</span><span class="o">:</span> <span class="k">function</span><span class="o">()</span> <span class="o">{</span>
            <span class="k">var</span> <span class="nx">coords</span> <span class="o">=</span> <span class="o">{</span>
                <span class="nx">top</span><span class="o">:</span> <span class="nb">parseInt</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">_resize</span><span class="o">.</span><span class="nx">getWrapEl</span><span class="o">().</span><span class="nx">style</span><span class="o">.</span><span class="nx">top</span><span class="o">,</span> <span class="m">10</span><span class="o">),</span>
                <span class="nx">left</span><span class="o">:</span> <span class="nb">parseInt</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">_resize</span><span class="o">.</span><span class="nx">getWrapEl</span><span class="o">().</span><span class="nx">style</span><span class="o">.</span><span class="nx">left</span><span class="o">,</span> <span class="m">10</span><span class="o">),</span>
                <span class="nx">height</span><span class="o">:</span> <span class="k">this</span><span class="o">.</span><span class="nx">_resize</span><span class="o">.</span><span class="nx">_cache</span><span class="o">.</span><span class="nx">height</span><span class="o">,</span>
                <span class="nx">width</span><span class="o">:</span> <span class="k">this</span><span class="o">.</span><span class="nx">_resize</span><span class="o">.</span><span class="nx">_cache</span><span class="o">.</span><span class="nx">width</span><span class="o">,</span>
                <span class="nx">image</span><span class="o">:</span> <span class="k">this</span><span class="o">.</span><span class="nx">_image</span>
            <span class="o">};</span>
            <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">log</span><span class="o">(</span><span class="s1">&#39;Getting the crop coordinates: &#39;</span> <span class="o">+</span> <span class="nx">Lang</span><span class="o">.</span><span class="nx">dump</span><span class="o">(</span><span class="nx">coords</span><span class="o">),</span> <span class="s1">&#39;log&#39;</span><span class="o">,</span> <span class="s1">&#39;ImageCropper&#39;</span><span class="o">);</span>
            <span class="k">return</span> <span class="nx">coords</span><span class="o">;</span>
        <span class="o">},</span>
        <span class="c">/**</span>
<span class="c">        * @method reset</span>
<span class="c">        * @description Resets the crop element back to it&#39;s original position</span>
<span class="c">        * @return {&lt;a href=&quot;YAHOO.widget.ImageCropper.html&quot;&gt;YAHOO.widget.ImageCropper&lt;/a&gt;} The ImageCropper instance</span>
<span class="c">        */</span>
        <span class="nx">reset</span><span class="o">:</span> <span class="k">function</span><span class="o">()</span> <span class="o">{</span>
            <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">log</span><span class="o">(</span><span class="s1">&#39;Resetting the control&#39;</span><span class="o">,</span> <span class="s1">&#39;log&#39;</span><span class="o">,</span> <span class="s1">&#39;ImageCropper&#39;</span><span class="o">);</span>
            <span class="k">this</span><span class="o">.</span><span class="nx">_resize</span><span class="o">.</span><span class="nx">resize</span><span class="o">(</span><span class="kc">null</span><span class="o">,</span> <span class="k">this</span><span class="o">.</span><span class="nx">get</span><span class="o">(</span><span class="s1">&#39;initHeight&#39;</span><span class="o">),</span> <span class="k">this</span><span class="o">.</span><span class="nx">get</span><span class="o">(</span><span class="s1">&#39;initWidth&#39;</span><span class="o">),</span> <span class="m">0</span><span class="o">,</span> <span class="m">0</span><span class="o">,</span> <span class="kc">true</span><span class="o">);</span>
            <span class="k">this</span><span class="o">.</span><span class="nx">_resizeEl</span><span class="o">.</span><span class="nx">style</span><span class="o">.</span><span class="nx">top</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">get</span><span class="o">(</span><span class="s1">&#39;initialXY&#39;</span><span class="o">)[</span><span class="m">1</span><span class="o">]</span> <span class="o">+</span> <span class="s1">&#39;px&#39;</span><span class="o">;</span>
            <span class="k">this</span><span class="o">.</span><span class="nx">_resizeEl</span><span class="o">.</span><span class="nx">style</span><span class="o">.</span><span class="nx">left</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">get</span><span class="o">(</span><span class="s1">&#39;initialXY&#39;</span><span class="o">)[</span><span class="m">0</span><span class="o">]</span> <span class="o">+</span> <span class="s1">&#39;px&#39;</span><span class="o">;</span>
            <span class="k">this</span><span class="o">.</span><span class="nx">_syncBackgroundPosition</span><span class="o">();</span>
            <span class="k">return</span> <span class="k">this</span><span class="o">;</span>
        <span class="o">},</span>

        <span class="c">/**</span>
<span class="c">        * @method getEl</span>
<span class="c">        * @description Get the HTML reference for the image element.</span>
<span class="c">        * @return {HTMLElement} The image element</span>
<span class="c">        */</span>      
        <span class="nx">getEl</span><span class="o">:</span> <span class="k">function</span><span class="o">()</span> <span class="o">{</span>
            <span class="k">return</span> <span class="k">this</span><span class="o">.</span><span class="nx">get</span><span class="o">(</span><span class="s1">&#39;element&#39;</span><span class="o">);</span>
        <span class="o">},</span>
        <span class="c">/**</span>
<span class="c">        * @method getResizeEl</span>
<span class="c">        * @description Get the HTML reference for the resize element.</span>
<span class="c">        * @return {HTMLElement} The resize element</span>
<span class="c">        */</span>      
        <span class="nx">getResizeEl</span><span class="o">:</span> <span class="k">function</span><span class="o">()</span> <span class="o">{</span>
            <span class="k">return</span> <span class="k">this</span><span class="o">.</span><span class="nx">_resizeEl</span><span class="o">;</span>
        <span class="o">},</span>
        <span class="c">/**</span>
<span class="c">        * @method getWrapEl</span>
<span class="c">        * @description Get the HTML reference for the wrap element.</span>
<span class="c">        * @return {HTMLElement} The wrap element</span>
<span class="c">        */</span>      
        <span class="nx">getWrapEl</span><span class="o">:</span> <span class="k">function</span><span class="o">()</span> <span class="o">{</span>
            <span class="k">return</span> <span class="k">this</span><span class="o">.</span><span class="nx">_wrap</span><span class="o">;</span>
        <span class="o">},</span>

        <span class="c">/**</span>
<span class="c">        * @method getMaskEl</span>
<span class="c">        * @description Get the HTML reference for the mask element.</span>
<span class="c">        * @return {HTMLElement} The mask element</span>
<span class="c">        */</span>      
        <span class="nx">getMaskEl</span><span class="o">:</span> <span class="k">function</span><span class="o">()</span> <span class="o">{</span>
            <span class="k">return</span> <span class="k">this</span><span class="o">.</span><span class="nx">_mask</span><span class="o">;</span>
        <span class="o">},</span>

        <span class="c">/**</span>
<span class="c">        * @method getResizeMaskEl</span>
<span class="c">        * @description Get the HTML reference for the resizable object&#39;s mask element.</span>
<span class="c">        * @return {HTMLElement} The resize objects mask element.</span>
<span class="c">        */</span>      
        <span class="nx">getResizeMaskEl</span><span class="o">:</span> <span class="k">function</span><span class="o">()</span> <span class="o">{</span>
            <span class="k">return</span> <span class="k">this</span><span class="o">.</span><span class="nx">_resizeMaskEl</span><span class="o">;</span>
        <span class="o">},</span>

        <span class="c">/**</span>
<span class="c">        * @method getResizeObject</span>
<span class="c">        * @description Get the Resize Utility object.</span>
<span class="c">        * @return {&lt;a href=&quot;YAHOO.util.Resize.html&quot;&gt;YAHOO.util.Resize&lt;/a&gt;} The Resize instance</span>
<span class="c">        */</span>      
        <span class="nx">getResizeObject</span><span class="o">:</span> <span class="k">function</span><span class="o">()</span> <span class="o">{</span>
            <span class="k">return</span> <span class="k">this</span><span class="o">.</span><span class="nx">_resize</span><span class="o">;</span>
        <span class="o">},</span>

        <span class="c">/** </span>
<span class="c">        * @private</span>
<span class="c">        * @method init</span>
<span class="c">        * @description The ImageCropper class&#39;s initialization method</span>
<span class="c">        */</span>        
        <span class="nx">init</span><span class="o">:</span> <span class="k">function</span><span class="o">(</span><span class="nx">p_oElement</span><span class="o">,</span> <span class="nx">p_oAttributes</span><span class="o">)</span> <span class="o">{</span>
            <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">log</span><span class="o">(</span><span class="s1">&#39;init&#39;</span><span class="o">,</span> <span class="s1">&#39;info&#39;</span><span class="o">,</span> <span class="s1">&#39;ImageCropper&#39;</span><span class="o">);</span>
            <span class="nx">Crop</span><span class="o">.</span><span class="nx">superclass</span><span class="o">.</span><span class="nx">init</span><span class="o">.</span><span class="nx">call</span><span class="o">(</span><span class="k">this</span><span class="o">,</span> <span class="nx">p_oElement</span><span class="o">,</span> <span class="nx">p_oAttributes</span><span class="o">);</span>

            <span class="k">var</span> <span class="nx">id</span> <span class="o">=</span> <span class="nx">p_oElement</span><span class="o">;</span>

            <span class="k">if</span> <span class="o">(!</span><span class="nx">Lang</span><span class="o">.</span><span class="nx">isString</span><span class="o">(</span><span class="nx">id</span><span class="o">))</span> <span class="o">{</span>
                <span class="k">if</span> <span class="o">(</span><span class="nx">id</span><span class="o">.</span><span class="nx">tagName</span> <span class="o">&amp;&amp;</span> <span class="o">(</span><span class="nx">id</span><span class="o">.</span><span class="nx">tagName</span><span class="o">.</span><span class="nx">toLowerCase</span><span class="o">()</span> <span class="o">==</span> <span class="s1">&#39;img&#39;</span><span class="o">))</span> <span class="o">{</span>
                    <span class="nx">id</span> <span class="o">=</span> <span class="nx">Dom</span><span class="o">.</span><span class="nx">generateId</span><span class="o">(</span><span class="nx">id</span><span class="o">);</span>                    
                <span class="o">}</span> <span class="k">else</span> <span class="o">{</span>
                    <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">log</span><span class="o">(</span><span class="s1">&#39;Element is not an image.&#39;</span><span class="o">,</span> <span class="s1">&#39;error&#39;</span><span class="o">,</span> <span class="s1">&#39;ImageCropper&#39;</span><span class="o">);</span>
                    <span class="k">return</span> <span class="kc">false</span><span class="o">;</span>
                <span class="o">}</span>
            <span class="o">}</span> <span class="k">else</span> <span class="o">{</span>
                <span class="k">var</span> <span class="nx">el</span> <span class="o">=</span> <span class="nx">Dom</span><span class="o">.</span><span class="nx">get</span><span class="o">(</span><span class="nx">id</span><span class="o">);</span>
                <span class="k">if</span> <span class="o">(</span><span class="nx">el</span><span class="o">.</span><span class="nx">tagName</span> <span class="o">&amp;&amp;</span> <span class="nx">el</span><span class="o">.</span><span class="nx">tagName</span><span class="o">.</span><span class="nx">toLowerCase</span><span class="o">()</span> <span class="o">==</span> <span class="s1">&#39;img&#39;</span><span class="o">)</span> <span class="o">{</span>
                    <span class="c">//All good</span>
<span class="c"></span>                <span class="o">}</span> <span class="k">else</span> <span class="o">{</span>
                    <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">log</span><span class="o">(</span><span class="s1">&#39;Element is not an image.&#39;</span><span class="o">,</span> <span class="s1">&#39;error&#39;</span><span class="o">,</span> <span class="s1">&#39;ImageCropper&#39;</span><span class="o">);</span>
                    <span class="k">return</span> <span class="kc">false</span><span class="o">;</span>
                <span class="o">}</span>
            <span class="o">}</span>
            


            <span class="nx">Crop</span><span class="o">.</span><span class="nx">_instances</span><span class="o">[</span><span class="nx">id</span><span class="o">]</span> <span class="o">=</span> <span class="k">this</span><span class="o">;</span>
            <span class="k">this</span><span class="o">.</span><span class="nx">_createWrap</span><span class="o">();</span>
            <span class="k">this</span><span class="o">.</span><span class="nx">_createMask</span><span class="o">();</span>
            <span class="k">this</span><span class="o">.</span><span class="nx">_createResize</span><span class="o">();</span>
            <span class="k">this</span><span class="o">.</span><span class="nx">_setConstraints</span><span class="o">();</span>

        <span class="o">},</span>
        <span class="c">/**</span>
<span class="c">        * @private</span>
<span class="c">        * @method initAttributes</span>
<span class="c">        * @description Initializes all of the configuration attributes used to create a croppable element.</span>
<span class="c">        * @param {Object} attr Object literal specifying a set of </span>
<span class="c">        * configuration attributes used to create the widget.</span>
<span class="c">        */</span>      

        <span class="nx">initAttributes</span><span class="o">:</span> <span class="k">function</span><span class="o">(</span><span class="nx">attr</span><span class="o">)</span> <span class="o">{</span>
            <span class="nx">Crop</span><span class="o">.</span><span class="nx">superclass</span><span class="o">.</span><span class="nx">initAttributes</span><span class="o">.</span><span class="nx">call</span><span class="o">(</span><span class="k">this</span><span class="o">,</span> <span class="nx">attr</span><span class="o">);</span>

            <span class="c">/**</span>
<span class="c">            * @attribute initialXY</span>
<span class="c">            * @description Array of the XY position that we need to set the crop element to when we build it. Defaults to [10, 10]</span>
<span class="c">            * @type Array</span>
<span class="c">            */</span>
            <span class="k">this</span><span class="o">.</span><span class="nx">setAttributeConfig</span><span class="o">(</span><span class="s1">&#39;initialXY&#39;</span><span class="o">,</span> <span class="o">{</span>
                <span class="nx">writeOnce</span><span class="o">:</span> <span class="kc">true</span><span class="o">,</span>
                <span class="nx">validator</span><span class="o">:</span> <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">lang</span><span class="o">.</span><span class="nx">isArray</span><span class="o">,</span>
                <span class="nx">value</span><span class="o">:</span> <span class="nx">attr</span><span class="o">.</span><span class="nx">initialXY</span> <span class="o">||</span> <span class="o">[</span><span class="m">10</span><span class="o">,</span> <span class="m">10</span><span class="o">]</span>
            <span class="o">});</span>
            <span class="c">/**</span>
<span class="c">            * @attribute keyTick</span>
<span class="c">            * @description The pixel tick for the arrow keys, defaults to 1</span>
<span class="c">            * @type Number</span>
<span class="c">            */</span>
            <span class="k">this</span><span class="o">.</span><span class="nx">setAttributeConfig</span><span class="o">(</span><span class="s1">&#39;keyTick&#39;</span><span class="o">,</span> <span class="o">{</span>
                <span class="nx">validator</span><span class="o">:</span> <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">lang</span><span class="o">.</span><span class="nx">isNumber</span><span class="o">,</span>
                <span class="nx">value</span><span class="o">:</span> <span class="nx">attr</span><span class="o">.</span><span class="nx">keyTick</span> <span class="o">||</span> <span class="m">1</span>
            <span class="o">});</span>

            <span class="c">/**</span>
<span class="c">            * @attribute shiftKeyTick</span>
<span class="c">            * @description The pixel tick for shift + the arrow keys, defaults to 10</span>
<span class="c">            * @type Number</span>
<span class="c">            */</span>
            <span class="k">this</span><span class="o">.</span><span class="nx">setAttributeConfig</span><span class="o">(</span><span class="s1">&#39;shiftKeyTick&#39;</span><span class="o">,</span> <span class="o">{</span>
                <span class="nx">validator</span><span class="o">:</span> <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">lang</span><span class="o">.</span><span class="nx">isNumber</span><span class="o">,</span>
                <span class="nx">value</span><span class="o">:</span> <span class="nx">attr</span><span class="o">.</span><span class="nx">shiftKeyTick</span> <span class="o">||</span> <span class="m">10</span>
            <span class="o">});</span>

            <span class="c">/**</span>
<span class="c">            * @attribute useKeys</span>
<span class="c">            * @description Should we use the Arrow keys to position the crop element, defaults to true</span>
<span class="c">            * @type Boolean</span>
<span class="c">            */</span>
            <span class="k">this</span><span class="o">.</span><span class="nx">setAttributeConfig</span><span class="o">(</span><span class="s1">&#39;useKeys&#39;</span><span class="o">,</span> <span class="o">{</span>
                <span class="nx">validator</span><span class="o">:</span> <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">lang</span><span class="o">.</span><span class="nx">isBoolean</span><span class="o">,</span>
                <span class="nx">value</span><span class="o">:</span> <span class="o">((</span><span class="nx">attr</span><span class="o">.</span><span class="nx">useKeys</span> <span class="o">===</span> <span class="kc">false</span><span class="o">)</span> <span class="o">?</span> <span class="kc">false</span> <span class="o">:</span> <span class="kc">true</span><span class="o">)</span>
            <span class="o">});</span>

            <span class="c">/**</span>
<span class="c">            * @attribute status</span>
<span class="c">            * @description Show the Resize Utility status, defaults to true</span>
<span class="c">            * @type Boolean</span>
<span class="c">            */</span>
            <span class="k">this</span><span class="o">.</span><span class="nx">setAttributeConfig</span><span class="o">(</span><span class="s1">&#39;status&#39;</span><span class="o">,</span> <span class="o">{</span>
                <span class="nx">validator</span><span class="o">:</span> <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">lang</span><span class="o">.</span><span class="nx">isBoolean</span><span class="o">,</span>
                <span class="nx">value</span><span class="o">:</span> <span class="o">((</span><span class="nx">attr</span><span class="o">.</span><span class="nx">status</span> <span class="o">===</span> <span class="kc">false</span><span class="o">)</span> <span class="o">?</span> <span class="kc">false</span> <span class="o">:</span> <span class="kc">true</span><span class="o">),</span>
                <span class="nx">method</span><span class="o">:</span> <span class="k">function</span><span class="o">(</span><span class="nx">status</span><span class="o">)</span> <span class="o">{</span>
                    <span class="k">if</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">_resize</span><span class="o">)</span> <span class="o">{</span>
                        <span class="k">this</span><span class="o">.</span><span class="nx">_resize</span><span class="o">.</span><span class="nx">set</span><span class="o">(</span><span class="s1">&#39;status&#39;</span><span class="o">,</span> <span class="nx">status</span><span class="o">);</span>
                    <span class="o">}</span>
                <span class="o">}</span>
            <span class="o">});</span>

            <span class="c">/**</span>
<span class="c">            * @attribute minHeight</span>
<span class="c">            * @description MinHeight of the crop area, default 50</span>
<span class="c">            * @type Number</span>
<span class="c">            */</span>
            <span class="k">this</span><span class="o">.</span><span class="nx">setAttributeConfig</span><span class="o">(</span><span class="s1">&#39;minHeight&#39;</span><span class="o">,</span> <span class="o">{</span>
                <span class="nx">validator</span><span class="o">:</span> <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">lang</span><span class="o">.</span><span class="nx">isNumber</span><span class="o">,</span>
                <span class="nx">value</span><span class="o">:</span> <span class="nx">attr</span><span class="o">.</span><span class="nx">minHeight</span> <span class="o">||</span> <span class="m">50</span><span class="o">,</span>
                <span class="nx">method</span><span class="o">:</span> <span class="k">function</span><span class="o">(</span><span class="nx">h</span><span class="o">)</span> <span class="o">{</span>
                    <span class="k">if</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">_resize</span><span class="o">)</span> <span class="o">{</span>
                        <span class="k">this</span><span class="o">.</span><span class="nx">_resize</span><span class="o">.</span><span class="nx">set</span><span class="o">(</span><span class="s1">&#39;minHeight&#39;</span><span class="o">,</span> <span class="nx">h</span><span class="o">);</span>
                    <span class="o">}</span>
                <span class="o">}</span>
            <span class="o">});</span>

            <span class="c">/**</span>
<span class="c">            * @attribute minWidth</span>
<span class="c">            * @description MinWidth of the crop area, default 50.</span>
<span class="c">            * @type Number</span>
<span class="c">            */</span>
            <span class="k">this</span><span class="o">.</span><span class="nx">setAttributeConfig</span><span class="o">(</span><span class="s1">&#39;minWidth&#39;</span><span class="o">,</span> <span class="o">{</span>
                <span class="nx">validator</span><span class="o">:</span> <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">lang</span><span class="o">.</span><span class="nx">isNumber</span><span class="o">,</span>
                <span class="nx">value</span><span class="o">:</span> <span class="nx">attr</span><span class="o">.</span><span class="nx">minWidth</span> <span class="o">||</span> <span class="m">50</span><span class="o">,</span>
                <span class="nx">method</span><span class="o">:</span> <span class="k">function</span><span class="o">(</span><span class="nx">w</span><span class="o">)</span> <span class="o">{</span>
                    <span class="k">if</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">_resize</span><span class="o">)</span> <span class="o">{</span>
                        <span class="k">this</span><span class="o">.</span><span class="nx">_resize</span><span class="o">.</span><span class="nx">set</span><span class="o">(</span><span class="s1">&#39;minWidth&#39;</span><span class="o">,</span> <span class="nx">w</span><span class="o">);</span>
                    <span class="o">}</span>
                <span class="o">}</span>
            <span class="o">});</span>

            <span class="c">/**</span>
<span class="c">            * @attribute ratio</span>
<span class="c">            * @description Set the ratio config option of the Resize Utlility, default false</span>
<span class="c">            * @type Boolean</span>
<span class="c">            */</span>
            <span class="k">this</span><span class="o">.</span><span class="nx">setAttributeConfig</span><span class="o">(</span><span class="s1">&#39;ratio&#39;</span><span class="o">,</span> <span class="o">{</span>
                <span class="nx">validator</span><span class="o">:</span> <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">lang</span><span class="o">.</span><span class="nx">isBoolean</span><span class="o">,</span>
                <span class="nx">value</span><span class="o">:</span> <span class="nx">attr</span><span class="o">.</span><span class="nx">ratio</span> <span class="o">||</span> <span class="kc">false</span><span class="o">,</span>
                <span class="nx">method</span><span class="o">:</span> <span class="k">function</span><span class="o">(</span><span class="nx">r</span><span class="o">)</span> <span class="o">{</span>
                    <span class="k">if</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">_resize</span><span class="o">)</span> <span class="o">{</span>
                        <span class="k">this</span><span class="o">.</span><span class="nx">_resize</span><span class="o">.</span><span class="nx">set</span><span class="o">(</span><span class="s1">&#39;ratio&#39;</span><span class="o">,</span> <span class="nx">r</span><span class="o">);</span>
                    <span class="o">}</span>
                <span class="o">}</span>
            <span class="o">});</span>

            <span class="c">/**</span>
<span class="c">            * @attribute ratio</span>
<span class="c">            * @description Set the autoRatio config option of the Resize Utlility, default true</span>
<span class="c">            * @type Boolean</span>
<span class="c">            */</span>
            <span class="k">this</span><span class="o">.</span><span class="nx">setAttributeConfig</span><span class="o">(</span><span class="s1">&#39;autoRatio&#39;</span><span class="o">,</span> <span class="o">{</span>
                <span class="nx">validator</span><span class="o">:</span> <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">lang</span><span class="o">.</span><span class="nx">isBoolean</span><span class="o">,</span>
                <span class="nx">value</span><span class="o">:</span> <span class="o">((</span><span class="nx">attr</span><span class="o">.</span><span class="nx">autoRatio</span> <span class="o">===</span> <span class="kc">false</span><span class="o">)</span> <span class="o">?</span> <span class="kc">false</span> <span class="o">:</span> <span class="kc">true</span><span class="o">),</span>
                <span class="nx">method</span><span class="o">:</span> <span class="k">function</span><span class="o">(</span><span class="nx">a</span><span class="o">)</span> <span class="o">{</span>
                    <span class="k">if</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">_resize</span><span class="o">)</span> <span class="o">{</span>
                        <span class="k">this</span><span class="o">.</span><span class="nx">_resize</span><span class="o">.</span><span class="nx">set</span><span class="o">(</span><span class="s1">&#39;autoRatio&#39;</span><span class="o">,</span> <span class="nx">a</span><span class="o">);</span>
                    <span class="o">}</span>
                <span class="o">}</span>
            <span class="o">});</span>

            <span class="c">/**</span>
<span class="c">            * @attribute initHeight</span>
<span class="c">            * @description Set the initlal height of the crop area, defaults to 1/4 of the image height</span>
<span class="c">            * @type Number</span>
<span class="c">            */</span>
            <span class="k">this</span><span class="o">.</span><span class="nx">setAttributeConfig</span><span class="o">(</span><span class="s1">&#39;initHeight&#39;</span><span class="o">,</span> <span class="o">{</span>
                <span class="nx">writeOnce</span><span class="o">:</span> <span class="kc">true</span><span class="o">,</span>
                <span class="nx">validator</span><span class="o">:</span> <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">lang</span><span class="o">.</span><span class="nx">isNumber</span><span class="o">,</span>
                <span class="nx">value</span><span class="o">:</span> <span class="nx">attr</span><span class="o">.</span><span class="nx">initHeight</span> <span class="o">||</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">get</span><span class="o">(</span><span class="s1">&#39;element&#39;</span><span class="o">).</span><span class="nx">height</span> <span class="o">/</span> <span class="m">4</span><span class="o">)</span>
            <span class="o">});</span>

            <span class="c">/**</span>
<span class="c">            * @attribute initWidth</span>
<span class="c">            * @description Set the initlal width of the crop area, defaults to 1/4 of the image width</span>
<span class="c">            * @type Number</span>
<span class="c">            */</span>
            <span class="k">this</span><span class="o">.</span><span class="nx">setAttributeConfig</span><span class="o">(</span><span class="s1">&#39;initWidth&#39;</span><span class="o">,</span> <span class="o">{</span>
                <span class="nx">validator</span><span class="o">:</span> <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">lang</span><span class="o">.</span><span class="nx">isNumber</span><span class="o">,</span>
                <span class="nx">writeOnce</span><span class="o">:</span> <span class="kc">true</span><span class="o">,</span>
                <span class="nx">value</span><span class="o">:</span> <span class="nx">attr</span><span class="o">.</span><span class="nx">initWidth</span> <span class="o">||</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">get</span><span class="o">(</span><span class="s1">&#39;element&#39;</span><span class="o">).</span><span class="nx">width</span> <span class="o">/</span> <span class="m">4</span><span class="o">)</span>
            <span class="o">});</span>

        <span class="o">},</span>
        <span class="c">/**</span>
<span class="c">        * @method destroy</span>
<span class="c">        * @description Destroys the ImageCropper object and all of it&#39;s elements &amp; listeners.</span>
<span class="c">        */</span>        
        <span class="nx">destroy</span><span class="o">:</span> <span class="k">function</span><span class="o">()</span> <span class="o">{</span>
            <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">log</span><span class="o">(</span><span class="s1">&#39;Destroying the ImageCropper&#39;</span><span class="o">,</span> <span class="s1">&#39;info&#39;</span><span class="o">,</span> <span class="s1">&#39;ImageCropper&#39;</span><span class="o">);</span>
            <span class="k">this</span><span class="o">.</span><span class="nx">_resize</span><span class="o">.</span><span class="nx">destroy</span><span class="o">();</span>
            <span class="k">this</span><span class="o">.</span><span class="nx">_resizeEl</span><span class="o">.</span><span class="nx">parentNode</span><span class="o">.</span><span class="nx">removeChild</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">_resizeEl</span><span class="o">);</span>
            <span class="k">this</span><span class="o">.</span><span class="nx">_mask</span><span class="o">.</span><span class="nx">parentNode</span><span class="o">.</span><span class="nx">removeChild</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">_mask</span><span class="o">);</span>
            <span class="nx">Event</span><span class="o">.</span><span class="nx">purgeElement</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">_wrap</span><span class="o">);</span>
            <span class="k">this</span><span class="o">.</span><span class="nx">_wrap</span><span class="o">.</span><span class="nx">parentNode</span><span class="o">.</span><span class="nx">replaceChild</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">get</span><span class="o">(</span><span class="s1">&#39;element&#39;</span><span class="o">),</span> <span class="k">this</span><span class="o">.</span><span class="nx">_wrap</span><span class="o">);</span>
            
            <span class="c">//Brutal Object Destroy</span>
<span class="c"></span>            <span class="k">for</span> <span class="o">(</span><span class="k">var</span> <span class="nx">i</span> <span class="k">in</span> <span class="k">this</span><span class="o">)</span> <span class="o">{</span>
                <span class="k">if</span> <span class="o">(</span><span class="nx">Lang</span><span class="o">.</span><span class="nx">hasOwnProperty</span><span class="o">(</span><span class="k">this</span><span class="o">,</span> <span class="nx">i</span><span class="o">))</span> <span class="o">{</span>
                    <span class="k">this</span><span class="o">[</span><span class="nx">i</span><span class="o">]</span> <span class="o">=</span> <span class="kc">null</span><span class="o">;</span>
                <span class="o">}</span>
            <span class="o">}</span>
                       
        <span class="o">},</span>
        <span class="c">/**</span>
<span class="c">        * @method toString</span>
<span class="c">        * @description Returns a string representing the ImageCropper Object.</span>
<span class="c">        * @return {String}</span>
<span class="c">        */</span>        
        <span class="nx">toString</span><span class="o">:</span> <span class="k">function</span><span class="o">()</span> <span class="o">{</span>
            <span class="k">if</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">get</span><span class="o">)</span> <span class="o">{</span>
                <span class="k">return</span> <span class="s1">&#39;ImageCropper (#&#39;</span> <span class="o">+</span> <span class="k">this</span><span class="o">.</span><span class="nx">get</span><span class="o">(</span><span class="s1">&#39;id&#39;</span><span class="o">)</span> <span class="o">+</span> <span class="s1">&#39;)&#39;</span><span class="o">;</span>
            <span class="o">}</span>
            <span class="k">return</span> <span class="s1">&#39;Image Cropper&#39;</span><span class="o">;</span>
        <span class="o">}</span>
    <span class="o">});</span>

    <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">ImageCropper</span> <span class="o">=</span> <span class="nx">Crop</span><span class="o">;</span>

<span class="c">/**</span>
<span class="c">* @event dragEvent</span>
<span class="c">* @description Fires when the DragDrop dragEvent</span>
<span class="c">* @type YAHOO.util.CustomEvent</span>
<span class="c">*/</span>
<span class="c">/**</span>
<span class="c">* @event startResizeEvent</span>
<span class="c">* @description Fires when when a resize action is started.</span>
<span class="c">* @type YAHOO.util.CustomEvent</span>
<span class="c">*/</span>
<span class="c">/**</span>
<span class="c">* @event resizeEvent</span>
<span class="c">* @description Fires on every element resize.</span>
<span class="c">* @type YAHOO.util.CustomEvent</span>
<span class="c">*/</span>
<span class="c">/**</span>
<span class="c">* @event moveEvent</span>
<span class="c">* @description Fires on every element move. Inside these methods: _handleKeyPress, _handleDragEvent, _handleResizeEvent</span>
<span class="c">* @type YAHOO.util.CustomEvent</span>
<span class="c">*/</span>

<span class="o">})();</span>
</pre></div>

                    </div>
			</div>
		</div>
		<div class="yui-b">
            <div class="nav">

                    <div id="moduleList" class="module">
                        <h4>Modules</h4>
                        <ul class="content">
                                <li class=""><a href="module_animation.html" title="animation">animation</a></li>
                                <li class=""><a href="module_autocomplete.html" title="autocomplete">autocomplete</a></li>
                                <li class=""><a href="module_button.html" title="button">button</a></li>
                                <li class=""><a href="module_calendar.html" title="calendar">calendar</a></li>
                                <li class=""><a href="module_carousel.html" title="carousel">carousel</a></li>
                                <li class=""><a href="module_charts.html" title="charts">charts</a></li>
                                <li class=""><a href="module_colorpicker.html" title="colorpicker">colorpicker</a></li>
                                <li class=""><a href="module_connection.html" title="connection">connection</a></li>
                                <li class=""><a href="module_container.html" title="container">container</a></li>
                                <li class=""><a href="module_cookie.html" title="cookie">cookie</a></li>
                                <li class=""><a href="module_datasource.html" title="datasource">datasource</a></li>
                                <li class=""><a href="module_datatable.html" title="datatable">datatable</a></li>
                                <li class=""><a href="module_dom.html" title="dom">dom</a></li>
                                <li class=""><a href="module_dragdrop.html" title="dragdrop">dragdrop</a></li>
                                <li class=""><a href="module_editor.html" title="editor">editor</a></li>
                                <li class=""><a href="module_element.html" title="element">element</a></li>
                                <li class=""><a href="module_element-delegate.html" title="element-delegate">element-delegate</a></li>
                                <li class=""><a href="module_event.html" title="event">event</a></li>
                                <li class=""><a href="module_event-delegate.html" title="event-delegate">event-delegate</a></li>
                                <li class=""><a href="module_event-mouseenter.html" title="event-mouseenter">event-mouseenter</a></li>
                                <li class=""><a href="module_event-simulate.html" title="event-simulate">event-simulate</a></li>
                                <li class=""><a href="module_get.html" title="get">get</a></li>
                                <li class=""><a href="module_history.html" title="history">history</a></li>
                                <li class="selected"><a href="module_imagecropper.html" title="imagecropper">imagecropper</a></li>
                                <li class=""><a href="module_imageloader.html" title="imageloader">imageloader</a></li>
                                <li class=""><a href="module_json.html" title="json">json</a></li>
                                <li class=""><a href="module_layout.html" title="layout">layout</a></li>
                                <li class=""><a href="module_logger.html" title="logger">logger</a></li>
                                <li class=""><a href="module_menu.html" title="menu">menu</a></li>
                                <li class=""><a href="module_paginator.html" title="paginator">paginator</a></li>
                                <li class=""><a href="module_profiler.html" title="profiler">profiler</a></li>
                                <li class=""><a href="module_profilerviewer.html" title="profilerviewer">profilerviewer</a></li>
                                <li class=""><a href="module_progressbar.html" title="progressbar">progressbar</a></li>
                                <li class=""><a href="module_resize.html" title="resize">resize</a></li>
                                <li class=""><a href="module_selector.html" title="selector">selector</a></li>
                                <li class=""><a href="module_slider.html" title="slider">slider</a></li>
                                <li class=""><a href="module_storage.html" title="Storage">Storage</a></li>
                                <li class=""><a href="module_stylesheet.html" title="stylesheet">stylesheet</a></li>
                                <li class=""><a href="module_swf.html" title="swf">swf</a></li>
                                <li class=""><a href="module_swfdetect.html" title="swfdetect">swfdetect</a></li>
                                <li class=""><a href="module_swfstore.html" title="swfstore">swfstore</a></li>
                                <li class=""><a href="module_tabview.html" title="tabview">tabview</a></li>
                                <li class=""><a href="module_treeview.html" title="treeview">treeview</a></li>
                                <li class=""><a href="module_uploader.html" title="uploader">uploader</a></li>
                                <li class=""><a href="module_yahoo.html" title="yahoo">yahoo</a></li>
                                <li class=""><a href="module_yuiloader.html" title="yuiloader">yuiloader</a></li>
                                <li class=""><a href="module_yuitest.html" title="yuitest">yuitest</a></li>
                        </ul>
                    </div>

                    <div id="classList" class="module">
                        <h4>Classes</h4>
                        <ul class="content">
                                <li class=""><a href="YAHOO.widget.ImageCropper.html" title="YAHOO.widget.ImageCropper">YAHOO.widget.ImageCropper</a></li>
                        </ul>
                    </div>

                    <div id="fileList" class="module">
                        <h4>Files</h4>
                        <ul class="content">        
                                <li class="selected"><a href="crop.js.html" title="crop.js">crop.js</a></li>
                        </ul>
                    </div>





            </div>
		</div>
	</div>
	<div id="ft">
        <hr />
        Copyright &copy; 2009 Yahoo! Inc. All rights reserved.
	</div>
</div>
<script type="text/javascript">
    ALL_YUI_PROPS = [{"access": "private", "host": "YAHOO.widget.ImageCropper", "name": "_active", "url": "YAHOO.widget.ImageCropper.html#property__active", "type": "property"}, {"access": "", "host": "YAHOO.widget.ImageCropper", "name": "beforeInitHeightChange", "url": "YAHOO.widget.ImageCropper.html#event_beforeInitHeightChange", "type": "event"}, {"access": "", "host": "YAHOO.widget.ImageCropper", "name": "beforeInitialXYChange", "url": "YAHOO.widget.ImageCropper.html#event_beforeInitialXYChange", "type": "event"}, {"access": "", "host": "YAHOO.widget.ImageCropper", "name": "beforeInitWidthChange", "url": "YAHOO.widget.ImageCropper.html#event_beforeInitWidthChange", "type": "event"}, {"access": "", "host": "YAHOO.widget.ImageCropper", "name": "beforeKeyTickChange", "url": "YAHOO.widget.ImageCropper.html#event_beforeKeyTickChange", "type": "event"}, {"access": "", "host": "YAHOO.widget.ImageCropper", "name": "beforeMinHeightChange", "url": "YAHOO.widget.ImageCropper.html#event_beforeMinHeightChange", "type": "event"}, {"access": "", "host": "YAHOO.widget.ImageCropper", "name": "beforeMinWidthChange", "url": "YAHOO.widget.ImageCropper.html#event_beforeMinWidthChange", "type": "event"}, {"access": "", "host": "YAHOO.widget.ImageCropper", "name": "beforeRatioChange", "url": "YAHOO.widget.ImageCropper.html#event_beforeRatioChange", "type": "event"}, {"access": "", "host": "YAHOO.widget.ImageCropper", "name": "beforeShiftKeyTickChange", "url": "YAHOO.widget.ImageCropper.html#event_beforeShiftKeyTickChange", "type": "event"}, {"access": "", "host": "YAHOO.widget.ImageCropper", "name": "beforeStatusChange", "url": "YAHOO.widget.ImageCropper.html#event_beforeStatusChange", "type": "event"}, {"access": "", "host": "YAHOO.widget.ImageCropper", "name": "beforeUseKeysChange", "url": "YAHOO.widget.ImageCropper.html#event_beforeUseKeysChange", "type": "event"}, {"access": "private", "host": "YAHOO.widget.ImageCropper", "name": "_createMask", "url": "YAHOO.widget.ImageCropper.html#method__createMask", "type": "method"}, {"access": "private", "host": "YAHOO.widget.ImageCropper", "name": "_createResize", "url": "YAHOO.widget.ImageCropper.html#method__createResize", "type": "method"}, {"access": "private", "host": "YAHOO.widget.ImageCropper", "name": "_createWrap", "url": "YAHOO.widget.ImageCropper.html#method__createWrap", "type": "method"}, {"access": "private", "host": "YAHOO.widget.ImageCropper", "name": "CSS_MAIN", "url": "YAHOO.widget.ImageCropper.html#property_CSS_MAIN", "type": "property"}, {"access": "private", "host": "YAHOO.widget.ImageCropper", "name": "CSS_MASK", "url": "YAHOO.widget.ImageCropper.html#property_CSS_MASK", "type": "property"}, {"access": "private", "host": "YAHOO.widget.ImageCropper", "name": "CSS_RESIZE_MASK", "url": "YAHOO.widget.ImageCropper.html#property_CSS_RESIZE_MASK", "type": "property"}, {"access": "", "host": "YAHOO.widget.ImageCropper", "name": "destroy", "url": "YAHOO.widget.ImageCropper.html#method_destroy", "type": "method"}, {"access": "", "host": "YAHOO.widget.ImageCropper", "name": "dragEvent", "url": "YAHOO.widget.ImageCropper.html#event_dragEvent", "type": "event"}, {"access": "", "host": "YAHOO.widget.ImageCropper", "name": "getCropCoords", "url": "YAHOO.widget.ImageCropper.html#method_getCropCoords", "type": "method"}, {"access": "", "host": "YAHOO.widget.ImageCropper", "name": "getCropperById", "url": "YAHOO.widget.ImageCropper.html#method_getCropperById", "type": "method"}, {"access": "", "host": "YAHOO.widget.ImageCropper", "name": "getEl", "url": "YAHOO.widget.ImageCropper.html#method_getEl", "type": "method"}, {"access": "", "host": "YAHOO.widget.ImageCropper", "name": "getMaskEl", "url": "YAHOO.widget.ImageCropper.html#method_getMaskEl", "type": "method"}, {"access": "", "host": "YAHOO.widget.ImageCropper", "name": "getResizeEl", "url": "YAHOO.widget.ImageCropper.html#method_getResizeEl", "type": "method"}, {"access": "", "host": "YAHOO.widget.ImageCropper", "name": "getResizeMaskEl", "url": "YAHOO.widget.ImageCropper.html#method_getResizeMaskEl", "type": "method"}, {"access": "", "host": "YAHOO.widget.ImageCropper", "name": "getResizeObject", "url": "YAHOO.widget.ImageCropper.html#method_getResizeObject", "type": "method"}, {"access": "", "host": "YAHOO.widget.ImageCropper", "name": "getWrapEl", "url": "YAHOO.widget.ImageCropper.html#method_getWrapEl", "type": "method"}, {"access": "private", "host": "YAHOO.widget.ImageCropper", "name": "_handleB4DragEvent", "url": "YAHOO.widget.ImageCropper.html#method__handleB4DragEvent", "type": "method"}, {"access": "private", "host": "YAHOO.widget.ImageCropper", "name": "_handleBeforeResizeEvent", "url": "YAHOO.widget.ImageCropper.html#method__handleBeforeResizeEvent", "type": "method"}, {"access": "private", "host": "YAHOO.widget.ImageCropper", "name": "_handleDragEvent", "url": "YAHOO.widget.ImageCropper.html#method__handleDragEvent", "type": "method"}, {"access": "private", "host": "YAHOO.widget.ImageCropper", "name": "_handleEndResizeEvent", "url": "YAHOO.widget.ImageCropper.html#method__handleEndResizeEvent", "type": "method"}, {"access": "private", "host": "YAHOO.widget.ImageCropper", "name": "_handleKeyPress", "url": "YAHOO.widget.ImageCropper.html#method__handleKeyPress", "type": "method"}, {"access": "private", "host": "YAHOO.widget.ImageCropper", "name": "_handleMouseOut", "url": "YAHOO.widget.ImageCropper.html#method__handleMouseOut", "type": "method"}, {"access": "private", "host": "YAHOO.widget.ImageCropper", "name": "_handleMouseOver", "url": "YAHOO.widget.ImageCropper.html#method__handleMouseOver", "type": "method"}, {"access": "private", "host": "YAHOO.widget.ImageCropper", "name": "_handleResizeEvent", "url": "YAHOO.widget.ImageCropper.html#method__handleResizeEvent", "type": "method"}, {"access": "private", "host": "YAHOO.widget.ImageCropper", "name": "_handleResizeMaskEl", "url": "YAHOO.widget.ImageCropper.html#method__handleResizeMaskEl", "type": "method"}, {"access": "private", "host": "YAHOO.widget.ImageCropper", "name": "_handleStartResizeEvent", "url": "YAHOO.widget.ImageCropper.html#method__handleStartResizeEvent", "type": "method"}, {"access": "private", "host": "YAHOO.widget.ImageCropper", "name": "_image", "url": "YAHOO.widget.ImageCropper.html#property__image", "type": "property"}, {"access": "private", "host": "YAHOO.widget.ImageCropper", "name": "init", "url": "YAHOO.widget.ImageCropper.html#method_init", "type": "method"}, {"access": "private", "host": "YAHOO.widget.ImageCropper", "name": "initAttributes", "url": "YAHOO.widget.ImageCropper.html#method_initAttributes", "type": "method"}, {"access": "", "host": "YAHOO.widget.ImageCropper", "name": "initHeight", "url": "YAHOO.widget.ImageCropper.html#config_initHeight", "type": "config"}, {"access": "", "host": "YAHOO.widget.ImageCropper", "name": "initHeightChange", "url": "YAHOO.widget.ImageCropper.html#event_initHeightChange", "type": "event"}, {"access": "", "host": "YAHOO.widget.ImageCropper", "name": "initialXY", "url": "YAHOO.widget.ImageCropper.html#config_initialXY", "type": "config"}, {"access": "", "host": "YAHOO.widget.ImageCropper", "name": "initialXYChange", "url": "YAHOO.widget.ImageCropper.html#event_initialXYChange", "type": "event"}, {"access": "", "host": "YAHOO.widget.ImageCropper", "name": "initWidth", "url": "YAHOO.widget.ImageCropper.html#config_initWidth", "type": "config"}, {"access": "", "host": "YAHOO.widget.ImageCropper", "name": "initWidthChange", "url": "YAHOO.widget.ImageCropper.html#event_initWidthChange", "type": "event"}, {"access": "private", "host": "YAHOO.widget.ImageCropper", "name": "_instances", "url": "YAHOO.widget.ImageCropper.html#property__instances", "type": "property"}, {"access": "", "host": "YAHOO.widget.ImageCropper", "name": "keyTick", "url": "YAHOO.widget.ImageCropper.html#config_keyTick", "type": "config"}, {"access": "", "host": "YAHOO.widget.ImageCropper", "name": "keyTickChange", "url": "YAHOO.widget.ImageCropper.html#event_keyTickChange", "type": "event"}, {"access": "private", "host": "YAHOO.widget.ImageCropper", "name": "_mask", "url": "YAHOO.widget.ImageCropper.html#property__mask", "type": "property"}, {"access": "", "host": "YAHOO.widget.ImageCropper", "name": "minHeight", "url": "YAHOO.widget.ImageCropper.html#config_minHeight", "type": "config"}, {"access": "", "host": "YAHOO.widget.ImageCropper", "name": "minHeightChange", "url": "YAHOO.widget.ImageCropper.html#event_minHeightChange", "type": "event"}, {"access": "", "host": "YAHOO.widget.ImageCropper", "name": "minWidth", "url": "YAHOO.widget.ImageCropper.html#config_minWidth", "type": "config"}, {"access": "", "host": "YAHOO.widget.ImageCropper", "name": "minWidthChange", "url": "YAHOO.widget.ImageCropper.html#event_minWidthChange", "type": "event"}, {"access": "private", "host": "YAHOO.widget.ImageCropper", "name": "_moveEl", "url": "YAHOO.widget.ImageCropper.html#method__moveEl", "type": "method"}, {"access": "", "host": "YAHOO.widget.ImageCropper", "name": "moveEvent", "url": "YAHOO.widget.ImageCropper.html#event_moveEvent", "type": "event"}, {"access": "", "host": "YAHOO.widget.ImageCropper", "name": "ratio", "url": "YAHOO.widget.ImageCropper.html#config_ratio", "type": "config"}, {"access": "", "host": "YAHOO.widget.ImageCropper", "name": "ratioChange", "url": "YAHOO.widget.ImageCropper.html#event_ratioChange", "type": "event"}, {"access": "", "host": "YAHOO.widget.ImageCropper", "name": "reset", "url": "YAHOO.widget.ImageCropper.html#method_reset", "type": "method"}, {"access": "private", "host": "YAHOO.widget.ImageCropper", "name": "_resize", "url": "YAHOO.widget.ImageCropper.html#property__resize", "type": "property"}, {"access": "private", "host": "YAHOO.widget.ImageCropper", "name": "_resizeEl", "url": "YAHOO.widget.ImageCropper.html#property__resizeEl", "type": "property"}, {"access": "", "host": "YAHOO.widget.ImageCropper", "name": "resizeEvent", "url": "YAHOO.widget.ImageCropper.html#event_resizeEvent", "type": "event"}, {"access": "private", "host": "YAHOO.widget.ImageCropper", "name": "_resizeMaskEl", "url": "YAHOO.widget.ImageCropper.html#property__resizeMaskEl", "type": "property"}, {"access": "private", "host": "YAHOO.widget.ImageCropper", "name": "_setBackgroundImage", "url": "YAHOO.widget.ImageCropper.html#method__setBackgroundImage", "type": "method"}, {"access": "private", "host": "YAHOO.widget.ImageCropper", "name": "_setBackgroundPosition", "url": "YAHOO.widget.ImageCropper.html#method__setBackgroundPosition", "type": "method"}, {"access": "private", "host": "YAHOO.widget.ImageCropper", "name": "_setConstraints", "url": "YAHOO.widget.ImageCropper.html#method__setConstraints", "type": "method"}, {"access": "", "host": "YAHOO.widget.ImageCropper", "name": "shiftKeyTick", "url": "YAHOO.widget.ImageCropper.html#config_shiftKeyTick", "type": "config"}, {"access": "", "host": "YAHOO.widget.ImageCropper", "name": "shiftKeyTickChange", "url": "YAHOO.widget.ImageCropper.html#event_shiftKeyTickChange", "type": "event"}, {"access": "", "host": "YAHOO.widget.ImageCropper", "name": "startResizeEvent", "url": "YAHOO.widget.ImageCropper.html#event_startResizeEvent", "type": "event"}, {"access": "", "host": "YAHOO.widget.ImageCropper", "name": "status", "url": "YAHOO.widget.ImageCropper.html#config_status", "type": "config"}, {"access": "", "host": "YAHOO.widget.ImageCropper", "name": "statusChange", "url": "YAHOO.widget.ImageCropper.html#event_statusChange", "type": "event"}, {"access": "private", "host": "YAHOO.widget.ImageCropper", "name": "_syncBackgroundPosition", "url": "YAHOO.widget.ImageCropper.html#method__syncBackgroundPosition", "type": "method"}, {"access": "", "host": "YAHOO.widget.ImageCropper", "name": "toString", "url": "YAHOO.widget.ImageCropper.html#method_toString", "type": "method"}, {"access": "", "host": "YAHOO.widget.ImageCropper", "name": "useKeys", "url": "YAHOO.widget.ImageCropper.html#config_useKeys", "type": "config"}, {"access": "", "host": "YAHOO.widget.ImageCropper", "name": "useKeysChange", "url": "YAHOO.widget.ImageCropper.html#event_useKeysChange", "type": "event"}, {"access": "private", "host": "YAHOO.widget.ImageCropper", "name": "_wrap", "url": "YAHOO.widget.ImageCropper.html#property__wrap", "type": "property"}];
</script>
</body>
</html>
